#[repr(C, align(16))]pub struct StaVector {
pub ct: f32,
pub x: f32,
pub y: f32,
pub z: f32,
}Expand description
Minkowski 4-vector in Spacetime Algebra Cl(1, 3). Basis: \gamma_0^2 = +1 (timelike), \gamma_1^2 = \gamma_2^2 = \gamma_3^2 = -1 (spacelike). Metric interval: s^2 = (ct)^2 - (x^2 + y^2 + z^2).
Fields§
§ct: f32§x: f32§y: f32§z: f32Implementations§
Source§impl StaVector
impl StaVector
pub const fn new(ct: f32, x: f32, y: f32, z: f32) -> Self
pub const fn zero() -> Self
Sourcepub fn interval_sq(&self) -> f32
pub fn interval_sq(&self) -> f32
Spacetime interval invariant s^2 = (ct)^2 - (x^2 + y^2 + z^2).
Sourcepub fn dot(&self, other: &Self) -> f32
pub fn dot(&self, other: &Self) -> f32
Minkowski inner product: u . v = u_0 * v_0 - (u_xv_x + u_yv_y + u_z*v_z).
Sourcepub fn is_timelike(&self) -> bool
pub fn is_timelike(&self) -> bool
Checks if interval is timelike (s^2 > 0).
Sourcepub fn is_spacelike(&self) -> bool
pub fn is_spacelike(&self) -> bool
Checks if interval is spacelike (s^2 < 0).
Sourcepub fn is_lightlike(&self) -> bool
pub fn is_lightlike(&self) -> bool
Checks if interval is lightlike / null (|s^2| < 1e-12).
Sourcepub fn proper_time(&self) -> Option<f32>
pub fn proper_time(&self) -> Option<f32>
Proper time interval \Delta \tau = sqrt(s^2) / c (with c = 1).
Trait Implementations§
impl Copy for StaVector
impl StructuralPartialEq for StaVector
Auto Trait Implementations§
impl Forget for StaVector
impl Freeze for StaVector
impl Move for StaVector
impl RefUnwindSafe for StaVector
impl Send for StaVector
impl Sync for StaVector
impl Unpin for StaVector
impl UnsafeUnpin for StaVector
impl UnwindSafe for StaVector
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