pub struct MomentumN<N, D>{ /* private fields */ }
Expand description

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§

source§

impl<N, D> MomentumN<N, D>

source

pub fn from_split(energy: &N, momentum: &OVector<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>,

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

source

pub fn from_mass_at_velocity(mass: N, velocity: OVector<N, D>) -> Self

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

source

pub fn from_mass_in_frame(mass: N, frame: &FrameN<N, D>) -> Self

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

Equals frame.velocity() * mass.

source

pub fn from_mass_at_rest(mass: N) -> Self

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

source

pub fn mass(&self) -> N

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

source

pub fn velocity(&self) -> OVector<N, D>

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

source

pub fn energy(&self) -> &N

Energy $E$ as LorentzianN::temporal component.

source

pub fn momentum(&self) -> VectorView<'_, 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>,

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

Trait Implementations§

source§

impl<N, D> Add for MomentumN<N, D>

§

type Output = MomentumN<N, D>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
source§

impl<N, D> Clone for MomentumN<N, D>

source§

fn clone(&self) -> MomentumN<N, D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<N, D> Debug for MomentumN<N, D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<N, D> From<Matrix<N, D, Const<1>, <DefaultAllocator as Allocator<N, D>>::Buffer>> for MomentumN<N, D>

source§

fn from(momentum: OVector<N, D>) -> Self

Converts to this type from the input type.
source§

impl<N, D> From<MomentumN<N, D>> for OVector<N, D>

source§

fn from(momentum: MomentumN<N, D>) -> Self

Converts to this type from the input type.
source§

impl<N, D> PartialEq for MomentumN<N, D>

source§

fn eq(&self, other: &MomentumN<N, D>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<N, D> Sub for MomentumN<N, D>

§

type Output = MomentumN<N, D>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
source§

impl<N, D> Copy for MomentumN<N, D>

source§

impl<N, D> StructuralPartialEq for MomentumN<N, D>

Auto Trait Implementations§

§

impl<N, D> !RefUnwindSafe for MomentumN<N, D>

§

impl<N, D> !Send for MomentumN<N, D>

§

impl<N, D> !Sync for MomentumN<N, D>

§

impl<N, D> !Unpin for MomentumN<N, D>

§

impl<N, D> !UnwindSafe for MomentumN<N, D>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,