pub struct LorentzMorphism {
pub velocity: Vec<f64>,
pub c: f64,
}Expand description
A Lorentz frame morphism — special relativistic 4D spacetime transformation.
Implements the exact 4-vector boost for arbitrary velocity vectors $\vec{v}$ with $|\vec{v}| < c$: $$ct’ = \gamma (ct - \vec{\beta} \cdot \vec{r})$$ $$\vec{r}’ = \vec{r} + \left( \frac{\gamma - 1}{v^2} (\vec{v} \cdot \vec{r}) - \gamma t \right) \vec{v}$$ Preserving the Minkowski spacetime invariant interval: $$s^2 = (c \Delta t)^2 - \Delta x^2 - \Delta y^2 - \Delta z^2$$
Fields§
§velocity: Vec<f64>Velocity of the target frame relative to the source (m/s).
c: f64Speed of light (default: 299_792_458 m/s).
Implementations§
Source§impl LorentzMorphism
impl LorentzMorphism
Sourcepub fn boost(vx: f64, vy: f64, vz: f64) -> Self
pub fn boost(vx: f64, vy: f64, vz: f64) -> Self
Create a pure velocity boost along given vector.
Sourcepub fn boost_matrix_4x4(&self) -> [[f64; 4]; 4]
pub fn boost_matrix_4x4(&self) -> [[f64; 4]; 4]
Compute the 4x4 Lorentz boost transformation matrix $\Lambda^\mu_{\ \nu}$. Basis order: [0]=ct, [1]=x, [2]=y, [3]=z.
Sourcepub fn transform_event(&self, t: f64, pos: &[f64]) -> (f64, Vec<f64>)
pub fn transform_event(&self, t: f64, pos: &[f64]) -> (f64, Vec<f64>)
Transform an event given as time t (seconds) and position [x, y, z] (meters). Returns (t_prime, [x_prime, y_prime, z_prime]).
Sourcepub fn boost_event(&self, ct: f64, r: &[f64]) -> (f64, Vec<f64>)
pub fn boost_event(&self, ct: f64, r: &[f64]) -> (f64, Vec<f64>)
Transform a 4-vector event (ct, [x, y, z]).
Sourcepub fn transform_position(&self, pos: &[f64], t: f64) -> Vec<f64>
pub fn transform_position(&self, pos: &[f64], t: f64) -> Vec<f64>
Transform 3D position at time t (compatibility with Galilean interface).
Sourcepub fn invariant_interval_squared(ct: f64, r: &[f64]) -> f64
pub fn invariant_interval_squared(ct: f64, r: &[f64]) -> f64
Invariant spacetime interval: s² = (ct)² - (x² + y² + z²).
Sourcepub fn honesty_label(&self) -> &'static str
pub fn honesty_label(&self) -> &'static str
Honesty label — Lorentz boost is fully implemented.