pub struct LorentzianSpacetime { /* private fields */ }Expand description
A 4-dimensional spacetime context based on Lorentzian geometry, as used in General Relativity.
LorentzianSpacetime encodes events in a curved or flat spacetime using the
Minkowski metric signature (−+++). This allows meaningful distinction between
time-like, space-like, and light-like intervals:
s² < 0: time-like separations² = 0: light-like (null) separations² > 0: space-like separation
The default implementation assumes flat spacetime (no curvature), suitable for special relativity. For curved general relativistic spacetime, a metric tensor can be added later.
§Fields
id: Unique numeric identifierx: X-coordinate in metersy: Y-coordinate in metersz: Z-coordinate in meterst: time (e.g., seconds)time_scale: Time scale unit (e.g., seconds, milliseconds)
§Coordinate Index Mapping
/// When used with the Coordinate trait, the following index mapping applies:
0 => x1 => y2 => z3 => t
§Minkowski interval (squared):
s² = -c²·t² + x² + y² + z²§Notes
- The time coordinate is not just a timestamp — it has physical meaning (e.g., proper time)
- The sign convention is configurable (−+++) or (+−−−), but we assume (−+++) by default
- Units must be consistent (e.g., all in SI)
§Example
use deep_causality::*;
let s1 = LorentzianSpacetime::new(1, 1.0, 0.0, 0.0, 0.0, TimeScale::Second);
let s2 = LorentzianSpacetime::new(2, 2.0, 3.0, 4.0, 0.0, TimeScale::Second);
let interval = s1.interval_squared(&s2);
println!("Minkowski interval²: {interval}");Implementations§
Trait Implementations§
Source§impl Adjustable<f64> for LorentzianSpacetime
impl Adjustable<f64> for LorentzianSpacetime
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>
The default implementation does nothing to keep update optional.
Override this method to implement a node update when needed.
For a sample implementation, see src/types/context_types/node_types_adjustable
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>
The default implementation does nothing to keep adjustment optional.
Override this method to implement a node adjustment when needed.
Depending on the type of node adjustment, select a 1, 2,3, or 4 dimensional array grid
that contains the transformation data to apply to the node.
For a sample implementation, see src/types/context_types/node_types_adjustable
Source§impl Clone for LorentzianSpacetime
impl Clone for LorentzianSpacetime
Source§fn clone(&self) -> LorentzianSpacetime
fn clone(&self) -> LorentzianSpacetime
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Coordinate<f64> for LorentzianSpacetime
impl Coordinate<f64> for LorentzianSpacetime
Source§impl Debug for LorentzianSpacetime
impl Debug for LorentzianSpacetime
Source§impl Display for LorentzianSpacetime
impl Display for LorentzianSpacetime
Source§impl Identifiable for LorentzianSpacetime
impl Identifiable for LorentzianSpacetime
Source§impl PartialEq for LorentzianSpacetime
impl PartialEq for LorentzianSpacetime
Source§impl SpaceTemporal<f64, f64> for LorentzianSpacetime
impl SpaceTemporal<f64, f64> for LorentzianSpacetime
Source§impl Temporal<f64> for LorentzianSpacetime
impl Temporal<f64> for LorentzianSpacetime
impl Spatial<f64> for LorentzianSpacetime
impl StructuralPartialEq for LorentzianSpacetime
Auto Trait Implementations§
impl Freeze for LorentzianSpacetime
impl RefUnwindSafe for LorentzianSpacetime
impl Send for LorentzianSpacetime
impl Sync for LorentzianSpacetime
impl Unpin for LorentzianSpacetime
impl UnwindSafe for LorentzianSpacetime
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more