pub struct EuclideanSpacetime { /* private fields */ }Expand description
A concrete 3D + time context based on classical (Euclidean) geometry.
EuclideanSpacetime models a spatial point in 3D Euclidean space with an
associated monotonic time unit (e.g., nanoseconds, milliseconds). This is
the default representation for causal modeling in low-latency engineering
systems such as sensor fusion, MagNav, or robotics.
The space is assumed to be flat and orthogonal (Cartesian), and time is treated as an absolute scalar clock.
§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
- Sensor placement and motion modeling
- Low-latency messaging with time-stamped spatial tags
- Aircraft, drone, or embedded system causal modeling
§Example
use deep_causality::*;
let s1 = EuclideanSpacetime::new(1, 0.0, 0.0, 0.0, 1_000_000.00f64, TimeScale::Second);
let s2 = EuclideanSpacetime::new(2, 3.0, 4.0, 0.0, 2_000_000.00f64, TimeScale::Second);
let spatial_dist = s1.distance(&s2); // should be 5.0
println!("Distance: {:.2} meters", spatial_dist);
assert_eq!(s1.dimension(), 4);
assert_eq!(s2.coordinate(0).unwrap(), &3.0);Implementations§
Trait Implementations§
Source§impl Adjustable<f64> for EuclideanSpacetime
impl Adjustable<f64> for EuclideanSpacetime
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 EuclideanSpacetime
impl Clone for EuclideanSpacetime
Source§fn clone(&self) -> EuclideanSpacetime
fn clone(&self) -> EuclideanSpacetime
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 EuclideanSpacetime
impl Coordinate<f64> for EuclideanSpacetime
Source§impl Debug for EuclideanSpacetime
impl Debug for EuclideanSpacetime
Source§impl Display for EuclideanSpacetime
impl Display for EuclideanSpacetime
Source§impl Identifiable for EuclideanSpacetime
impl Identifiable for EuclideanSpacetime
Source§impl Metric<f64> for EuclideanSpacetime
impl Metric<f64> for EuclideanSpacetime
Source§impl PartialEq for EuclideanSpacetime
impl PartialEq for EuclideanSpacetime
Source§impl SpaceTemporal<f64, f64> for EuclideanSpacetime
impl SpaceTemporal<f64, f64> for EuclideanSpacetime
Source§impl Temporal<f64> for EuclideanSpacetime
impl Temporal<f64> for EuclideanSpacetime
impl Copy for EuclideanSpacetime
impl Spatial<f64> for EuclideanSpacetime
impl StructuralPartialEq for EuclideanSpacetime
Auto Trait Implementations§
impl Freeze for EuclideanSpacetime
impl RefUnwindSafe for EuclideanSpacetime
impl Send for EuclideanSpacetime
impl Sync for EuclideanSpacetime
impl Unpin for EuclideanSpacetime
impl UnwindSafe for EuclideanSpacetime
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