[][src]Struct nalgebra_spacetime::MomentumN

pub struct MomentumN<N, D> where
    N: Scalar,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
{ /* fields omitted */ }

Momentum in $n$-dimensional Lorentzian space $\R^{-,+} = \R^{1,n-1}$.

Assuming unit system with speed of light $c=1$ and rest mass $m$ as timelike norm in spacelike sign convention as in:

$$ m^2=E^2-\vec {p}^2=-p_\mu p^\mu $$

Where $p^\mu$ is the $n$-momentum with energy $E$ as temporal $p^0$ and momentum $\vec p$ as spatial $p^i$ components:

$$ p^\mu = m u^\mu = m \begin{pmatrix} \gamma \\ \gamma \vec \beta \end{pmatrix} = \begin{pmatrix} \gamma m = E \\ \gamma m \vec \beta = \vec p \end{pmatrix} $$

With $n$-velocity $u^\mu$, Lorentz factor $\gamma$, and velocity ratio $\vec \beta$.

Implementations

impl<N, D> MomentumN<N, D> where
    N: SimdRealField + Signed + Real,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

pub fn from_split(energy: &N, momentum: &VectorN<N, DimNameDiff<D, U1>>) -> Self where
    DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>,
    <DefaultAllocator as Allocator<N, D, U1>>::Buffer: StorageMut<N, D, U1, RStride = U1, CStride = D>, 
[src]

Momentum with spacetime LorentzianN::split, energy $E$ and momentum $\vec p$.

pub fn from_mass_at_velocity(mass: N, velocity: VectorN<N, D>) -> Self where
    DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>, 
[src]

Momentum $p^\mu=m u^\mu$ with rest mass $m$ at velocity $u^\mu$.

pub fn from_mass_in_frame(mass: N, frame: FrameN<N, D>) -> Self where
    DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>, 
[src]

Momentum $p^\mu$ with rest mass $m$ in frame.

Equals frame.velocity() * mass.

pub fn from_mass_at_rest(mass: N) -> Self[src]

Momentum $p^\mu$ with rest mass $m$ in center-of-momentum frame.

pub fn mass(&self) -> N[src]

Rest mass $m$ as timelike norm $\sqrt{-p_\mu p^\mu}$ in spacelike sign convention.

pub fn velocity(&self) -> VectorN<N, D>[src]

Velocity $u^\mu$ as momentum $p^\mu$ divided by rest mass() $m$.

pub fn energy(&self) -> &N[src]

Energy $E$ as LorentzianN::temporal component.

pub fn momentum(&self) -> VectorSliceN<'_, N, DimNameDiff<D, U1>, U1, D> where
    DefaultAllocator: Allocator<N, D, U1>,
    <DefaultAllocator as Allocator<N, D, U1>>::Buffer: Storage<N, D, U1, RStride = U1, CStride = D>, 
[src]

Momentum $\vec p$ as LorentzianN::spatial components.

Trait Implementations

impl<N, D> Add<MomentumN<N, D>> for MomentumN<N, D> where
    N: SimdRealField + Signed + Real,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<N: Clone, D: Clone> Clone for MomentumN<N, D> where
    N: Scalar,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N, D> Copy for MomentumN<N, D> where
    N: SimdRealField + Signed + Real,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>,
    Owned<N, D>: Copy
[src]

impl<N: Debug, D: Debug> Debug for MomentumN<N, D> where
    N: Scalar,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N, D> From<Matrix<N, D, U1, <DefaultAllocator as Allocator<N, D, U1>>::Buffer>> for MomentumN<N, D> where
    N: SimdRealField + Signed + Real,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N, D> From<MomentumN<N, D>> for VectorN<N, D> where
    N: SimdRealField + Signed + Real,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N: PartialEq, D: PartialEq> PartialEq<MomentumN<N, D>> for MomentumN<N, D> where
    N: Scalar,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N, D> StructuralPartialEq for MomentumN<N, D> where
    N: Scalar,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

impl<N, D> Sub<MomentumN<N, D>> for MomentumN<N, D> where
    N: SimdRealField + Signed + Real,
    D: DimNameSub<U1>,
    DefaultAllocator: Allocator<N, D>, 
[src]

type Output = Self

The resulting type after applying the - operator.

Auto Trait Implementations

impl<N, D> !RefUnwindSafe for MomentumN<N, D>[src]

impl<N, D> !Send for MomentumN<N, D>[src]

impl<N, D> !Sync for MomentumN<N, D>[src]

impl<N, D> !Unpin for MomentumN<N, D>[src]

impl<N, D> !UnwindSafe for MomentumN<N, D>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,