pub struct InertiaTensor<F>where
F: Frame,{ /* private fields */ }Expand description
Mass moment of inertia tensor (kg·m²) expressed in frame F.
Symmetric in physically-meaningful instances, but the type does not
enforce symmetry — composition via Self::transform preserves it
when the input is symmetric and the rotation is proper.
§Frame-mismatch is a compile error
Adding inertia tensors expressed in different compile-time frames fails to typecheck rather than silently mis-summing them:
use astrodyn_quantities::frame::{Ecef, RootInertial};
use astrodyn_quantities::inertia::InertiaTensor;
let a = InertiaTensor::<RootInertial>::from_principal(1.0, 1.0, 1.0);
let b = InertiaTensor::<Ecef>::from_principal(1.0, 1.0, 1.0);
let _bad = a + b; // Add is only impl'd for matching framesImplementations§
Source§impl<F> InertiaTensor<F>where
F: Frame,
impl<F> InertiaTensor<F>where
F: Frame,
Sourcepub const fn from_dmat3_unchecked(value: DMat3) -> InertiaTensor<F>
pub const fn from_dmat3_unchecked(value: DMat3) -> InertiaTensor<F>
Wrap a raw DMat3 whose entries are interpreted as kg·m² in
frame F. The caller is responsible for the unit and for any
symmetry / positive-definite invariants the downstream physics
expects.
Sourcepub fn zero() -> InertiaTensor<F>
pub fn zero() -> InertiaTensor<F>
The zero tensor (useful as an accumulator seed).
Sourcepub fn from_principal(ixx: f64, iyy: f64, izz: f64) -> InertiaTensor<F>
pub fn from_principal(ixx: f64, iyy: f64, izz: f64) -> InertiaTensor<F>
Diagonal tensor with the given principal moments
(Ixx, Iyy, Izz); off-diagonal products are zero.
Sourcepub fn from_components(
ixx: f64,
iyy: f64,
izz: f64,
ixy: f64,
ixz: f64,
iyz: f64,
) -> InertiaTensor<F>
pub fn from_components( ixx: f64, iyy: f64, izz: f64, ixy: f64, ixz: f64, iyz: f64, ) -> InertiaTensor<F>
Symmetric tensor built from JEOD’s six-component layout:
Ixx, Iyy, Izz on the diagonal; Ixy, Ixz, Iyz mirrored across.
JEOD stores inertia products as +Ixy = ∫ x·y dm (no negation),
matching the convention used in
models/dynamics/mass/src/mass_properties_inertia.cc.
Sourcepub fn transpose(&self) -> InertiaTensor<F>
pub fn transpose(&self) -> InertiaTensor<F>
Transpose. For a symmetric inertia tensor this is the identity.
Sourcepub fn transform(&self, rot: &DMat3) -> InertiaTensor<F>
pub fn transform(&self, rot: &DMat3) -> InertiaTensor<F>
Numeric similarity transform T^T · I · T. Matches JEOD’s
transpose_transform_matrix usage in mass_properties.cc for
composing child inertia about a parent structural frame’s axes.
The frame phantom F is intentionally unchanged. This is
the numeric kernel; frame-changing must go through an explicit
retag (InertiaTensor::<NewFrame>::from_dmat3_unchecked(...))
or a future typed FrameTransform-style wrapper that updates
the phantom coherently. Calling transform alone does not
re-express the tensor in a different compile-time frame.
Trait Implementations§
Source§impl<F> Add for InertiaTensor<F>where
F: Frame,
Component-wise addition. Used by parallel-axis composition: the caller
supplies the offset contribution (m · ([d]² · I − d ⊗ d)) as another
InertiaTensor<F> in the same frame and adds it.
impl<F> Add for InertiaTensor<F>where
F: Frame,
Component-wise addition. Used by parallel-axis composition: the caller
supplies the offset contribution (m · ([d]² · I − d ⊗ d)) as another
InertiaTensor<F> in the same frame and adds it.
Source§type Output = InertiaTensor<F>
type Output = InertiaTensor<F>
+ operator.Source§fn add(self, rhs: InertiaTensor<F>) -> InertiaTensor<F>
fn add(self, rhs: InertiaTensor<F>) -> InertiaTensor<F>
+ operation. Read moreSource§impl<F> AddAssign for InertiaTensor<F>where
F: Frame,
impl<F> AddAssign for InertiaTensor<F>where
F: Frame,
Source§fn add_assign(&mut self, rhs: InertiaTensor<F>)
fn add_assign(&mut self, rhs: InertiaTensor<F>)
+= operation. Read moreSource§impl<F> Clone for InertiaTensor<F>where
F: Frame,
impl<F> Clone for InertiaTensor<F>where
F: Frame,
Source§fn clone(&self) -> InertiaTensor<F>
fn clone(&self) -> InertiaTensor<F>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<F> Debug for InertiaTensor<F>where
F: Frame,
impl<F> Debug for InertiaTensor<F>where
F: Frame,
Source§impl<F> Default for InertiaTensor<F>where
F: Frame,
impl<F> Default for InertiaTensor<F>where
F: Frame,
Source§fn default() -> InertiaTensor<F>
fn default() -> InertiaTensor<F>
Source§impl<F> Mul<f64> for InertiaTensor<F>where
F: Frame,
Scalar multiply on the right (tensor * f64). The left form
(f64 * tensor) is omitted — Mul<InertiaTensor<F>> for f64 would
require an F-generic foreign-impl that the orphan rules permit but
which adds little ergonomic value for what’s almost always a scalar
in user code.
impl<F> Mul<f64> for InertiaTensor<F>where
F: Frame,
Scalar multiply on the right (tensor * f64). The left form
(f64 * tensor) is omitted — Mul<InertiaTensor<F>> for f64 would
require an F-generic foreign-impl that the orphan rules permit but
which adds little ergonomic value for what’s almost always a scalar
in user code.
Source§type Output = InertiaTensor<F>
type Output = InertiaTensor<F>
* operator.Source§impl<F> Neg for InertiaTensor<F>where
F: Frame,
impl<F> Neg for InertiaTensor<F>where
F: Frame,
Source§type Output = InertiaTensor<F>
type Output = InertiaTensor<F>
- operator.Source§fn neg(self) -> InertiaTensor<F>
fn neg(self) -> InertiaTensor<F>
- operation. Read moreSource§impl<F> PartialEq for InertiaTensor<F>where
F: Frame,
impl<F> PartialEq for InertiaTensor<F>where
F: Frame,
Source§fn eq(&self, other: &InertiaTensor<F>) -> bool
fn eq(&self, other: &InertiaTensor<F>) -> bool
self and other values to be equal, and is used by ==.Source§impl<F> Sub for InertiaTensor<F>where
F: Frame,
impl<F> Sub for InertiaTensor<F>where
F: Frame,
Source§type Output = InertiaTensor<F>
type Output = InertiaTensor<F>
- operator.Source§fn sub(self, rhs: InertiaTensor<F>) -> InertiaTensor<F>
fn sub(self, rhs: InertiaTensor<F>) -> InertiaTensor<F>
- operation. Read moreSource§impl<F> SubAssign for InertiaTensor<F>where
F: Frame,
impl<F> SubAssign for InertiaTensor<F>where
F: Frame,
Source§fn sub_assign(&mut self, rhs: InertiaTensor<F>)
fn sub_assign(&mut self, rhs: InertiaTensor<F>)
-= operation. Read more