[−][src]Struct nalgebra_spacetime::MomentumN
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]
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
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]
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$.
pub fn from_mass_at_velocity(mass: N, velocity: VectorN<N, D>) -> Self where
DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>,
[src]
DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>,
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]
DefaultAllocator: Allocator<N, DimNameDiff<D, U1>>,
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]
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
impl<N, D> Add<MomentumN<N, D>> for MomentumN<N, D> where
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
type Output = Self
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl<N: Clone, D: Clone> Clone for MomentumN<N, D> where
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
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]
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
Owned<N, D>: Copy,
impl<N: Debug, D: Debug> Debug for MomentumN<N, D> where
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
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]
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
impl<N, D> From<MomentumN<N, D>> for VectorN<N, D> where
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
impl<N: PartialEq, D: PartialEq> PartialEq<MomentumN<N, D>> for MomentumN<N, D> where
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
fn eq(&self, other: &MomentumN<N, D>) -> bool
[src]
fn ne(&self, other: &MomentumN<N, D>) -> bool
[src]
impl<N, D> StructuralPartialEq for MomentumN<N, D> where
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: Scalar,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
impl<N, D> Sub<MomentumN<N, D>> for MomentumN<N, D> where
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
[src]
N: SimdRealField + Signed + Real,
D: DimNameSub<U1>,
DefaultAllocator: Allocator<N, D>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,