pub struct SpacetimePoint {
pub t: f64,
pub x: f64,
}Expand description
A spacetime event expressed as a (time, position) coordinate pair.
In the financial interpretation:
tis elapsed time since the series start, normalized to a convenient scale (e.g., seconds, or fraction of the session).xis normalized log-price or normalized price.
Fields§
§t: f64Time coordinate.
x: f64Spatial (price) coordinate.
Implementations§
Source§impl SpacetimePoint
impl SpacetimePoint
Sourcepub fn displacement(self, other: Self) -> Self
pub fn displacement(self, other: Self) -> Self
4-displacement from self to other: (Δt, Δx) = (other.t - self.t, other.x - self.x).
Useful for computing proper distances and intervals between events.
Sourcepub fn norm_sq(self) -> f64
pub fn norm_sq(self) -> f64
Minkowski norm squared: t² − x².
The sign classifies the causal relationship of the event to the origin:
- Positive: time-like (inside the light cone — causally reachable).
- Zero: light-like / null (on the light cone).
- Negative: space-like (outside the light cone — causally disconnected).
Sourcepub fn is_timelike(self) -> bool
pub fn is_timelike(self) -> bool
Returns true if this point is inside the light cone (t² > x²).
Sourcepub fn is_lightlike(self) -> bool
pub fn is_lightlike(self) -> bool
Returns true if this point lies on the light cone.
Uses a tolerance of 1e-10 for floating-point comparisons.
Sourcepub fn is_spacelike(self) -> bool
pub fn is_spacelike(self) -> bool
Returns true if this point is outside the light cone (t² < x²).
Sourcepub fn distance_to(self, other: Self) -> f64
pub fn distance_to(self, other: Self) -> f64
Proper spacetime distance between self and other.
Computed as sqrt(|Δt² − Δx²|) where Δ = other − self. The absolute
value ensures a real result regardless of the interval type.
For time-like separations this is the proper time; for space-like
separations it is the proper length.
Trait Implementations§
Source§impl Clone for SpacetimePoint
impl Clone for SpacetimePoint
Source§fn clone(&self) -> SpacetimePoint
fn clone(&self) -> SpacetimePoint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more