pub struct TangentSpacetime { /* private fields */ }Expand description
A 4D+4D spacetime model combining position and motion, with support for curved geometry.
TangentBundleSpacetime represents an event in spacetime along with its
tangent vector (velocity or proper motion). It also carries an embedded
metric tensor gᵤᵥ that defines the local geometry of spacetime,
allowing for proper interval calculations in curved manifolds.
This model generalizes both flat Minkowski spacetime and dynamic curved spacetime
(e.g., Schwarzschild or cosmological spacetimes) by exposing its metric via the
MetricTensor4D trait, and supporting runtime updates via
update_metric_tensor().
§Fields
id: Unique numeric identifierx: X-coordinate in metersy: Y-coordinate in metersz: Z-coordinate in meterst: time (e.g., seconds)dt: Proper time velocity (usually1.0)dx, dy, dz: Spatial velocity components (in meters/second)metric: Local 4×4 metric tensor defining the geometry
§Coordinate Index Mapping
When used with the Coordinate trait, the following index mapping applies:
0 => x1 => y2 => z3 => t
§Curvature Support
The default metric is flat Minkowski (− + + +), but this can be replaced at runtime:
use deep_causality::*;
let mut s = TangentSpacetime::new(1, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0);
// Replace with a custom curved spacetime metric (e.g., anisotropic)
let warped = [
[-8.98755179e16, 0.0, 0.0, 0.0],
[0.0, 1.05, 0.0, 0.0],
[0.0, 0.0, 0.95, 0.0],
[0.0, 0.0, 0.0, 0.90],
];
s.update_metric_tensor(warped);
let s2 = TangentSpacetime::new(2, 2.0, 3.0, 4.0, 0.0, 1.0, 0.0, 0.0, 0.0);
let interval = s.interval_squared(&s2);
println!("Curved spacetime interval²: {interval}");§References
- J.M. Lee, Introduction to Smooth Manifolds, Springer, 2012 — Chapter 8: Tangent Bundles
- R.M. Wald, General Relativity, University of Chicago Press, 1984 — Ch. 3: Curved Spacetime Geometry
§See also
SpacetimeInterval— for causal separation calculationsMetricTensor4D— for curvature configuration
Implementations§
Source§impl TangentSpacetime
impl TangentSpacetime
pub fn x(&self) -> f64
pub fn y(&self) -> f64
pub fn z(&self) -> f64
Sourcepub fn time_velocity(&self) -> f64
pub fn time_velocity(&self) -> f64
Returns the coordinate-time velocity (∂t/∂τ)
Sourcepub fn spatial_velocity(&self) -> f64
pub fn spatial_velocity(&self) -> f64
Computes spatial velocity magnitude (ignoring dt)
Sourcepub fn velocity_vector(&self) -> [f64; 3]
pub fn velocity_vector(&self) -> [f64; 3]
Returns 3D velocity vector
Sourcepub fn euclidean_distance(&self, other: &Self) -> f64
pub fn euclidean_distance(&self, other: &Self) -> f64
Computes Euclidean spatial distance to another point
Trait Implementations§
Source§impl Adjustable<f64> for TangentSpacetime
Updates the position of the TangentSpacetime node.
The metric tensor is updated via the ‘update_metric_tensor’ method.
impl Adjustable<f64> for TangentSpacetime
Updates the position of the TangentSpacetime node. The metric tensor is updated via the ‘update_metric_tensor’ method.
Source§fn adjust<const W: usize, const H: usize, const D: usize, const C: usize>(
&mut self,
array_grid: &ArrayGrid<f64, W, H, D, C>,
) -> Result<(), AdjustmentError>
fn adjust<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<f64, W, H, D, C>, ) -> Result<(), AdjustmentError>
Adjust the position of the TangentSpacetime node. The metric tensor is updated via the ‘update_metric_tensor’ method.
Source§fn update<const W: usize, const H: usize, const D: usize, const C: usize>(
&mut self,
array_grid: &ArrayGrid<f64, W, H, D, C>,
) -> Result<(), UpdateError>
fn update<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<f64, W, H, D, C>, ) -> Result<(), UpdateError>
Source§impl Clone for TangentSpacetime
impl Clone for TangentSpacetime
Source§fn clone(&self) -> TangentSpacetime
fn clone(&self) -> TangentSpacetime
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more