pub struct MinkowskiSpacetime { /* private fields */ }Expand description
A 4D spacetime context based on the Minkowski metric of special relativity.
MinkowskiSpacetime represents an event in flat spacetime using four real-valued coordinates:
t (time) and x, y, z (space). It assumes a Minkowski metric signature (−+++),
and enables interval calculations according to:
s² = −c²·Δt² + Δx² + Δy² + Δz²This allows precise modeling of:
- Time-like, space-like, and light-like (null) separations
- Proper time and relativistic intervals
- Special relativistic propagation constraints
§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., microseconds, milliseconds)
§Coordinate Index Mapping
When used with the Coordinate trait, the following index mapping applies:
0 => x1 => y2 => z3 => t
§Common Applications
- Relativistic simulation
- Causal propagation with light cones
- Quantum field theory spacetime diagrams
§Example
use deep_causality::*;
let e1 = MinkowskiSpacetime::new(1, 1.0, 0.0, 0.0, 0.0, TimeScale::Second);
let e2 = MinkowskiSpacetime::new(2, 3.0, 3.0, 4.0, 1.0, TimeScale::Second);
let s2 = e1.interval_squared(&e2);
println!("s² = {}", s2);
assert!(s2 < 0.0); // time-like intervalImplementations§
Trait Implementations§
Source§impl Adjustable<f64> for MinkowskiSpacetime
impl Adjustable<f64> for MinkowskiSpacetime
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 MinkowskiSpacetime
impl Clone for MinkowskiSpacetime
Source§fn clone(&self) -> MinkowskiSpacetime
fn clone(&self) -> MinkowskiSpacetime
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 MinkowskiSpacetime
impl Coordinate<f64> for MinkowskiSpacetime
Source§impl Debug for MinkowskiSpacetime
impl Debug for MinkowskiSpacetime
Source§impl Display for MinkowskiSpacetime
impl Display for MinkowskiSpacetime
Source§impl Identifiable for MinkowskiSpacetime
impl Identifiable for MinkowskiSpacetime
Source§impl PartialEq for MinkowskiSpacetime
impl PartialEq for MinkowskiSpacetime
Source§impl SpaceTemporal<f64, f64> for MinkowskiSpacetime
impl SpaceTemporal<f64, f64> for MinkowskiSpacetime
Source§impl Temporal<f64> for MinkowskiSpacetime
impl Temporal<f64> for MinkowskiSpacetime
impl Copy for MinkowskiSpacetime
impl Spatial<f64> for MinkowskiSpacetime
impl StructuralPartialEq for MinkowskiSpacetime
Auto Trait Implementations§
impl Freeze for MinkowskiSpacetime
impl RefUnwindSafe for MinkowskiSpacetime
impl Send for MinkowskiSpacetime
impl Sync for MinkowskiSpacetime
impl Unpin for MinkowskiSpacetime
impl UnwindSafe for MinkowskiSpacetime
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