pub struct ActiveHamiltonRotation {
pub raw_xyzw: [f64; 4],
pub raw_norm_sq: f64,
pub derived_xyzw: [f64; 4],
pub matrix: [[f64; 3]; 3],
}Expand description
Active local-to-parent Hamilton quaternion rotation ([x, y, z, w]) per C02-C04.
Retains the exact authored raw_xyzw bytes for provenance while computing
the derived normalized quaternion derived_xyzw and orthogonal rotation matrix $R(q)$
using the exact non-fused ordered sum (((x*x + y*y) + z*z) + w*w).
Fields§
§raw_xyzw: [f64; 4]§raw_norm_sq: f64§derived_xyzw: [f64; 4]§matrix: [[f64; 3]; 3]Implementations§
Source§impl ActiveHamiltonRotation
impl ActiveHamiltonRotation
Sourcepub fn admit(raw_xyzw: [f64; 4]) -> Result<Self, ConstitutiveError>
pub fn admit(raw_xyzw: [f64; 4]) -> Result<Self, ConstitutiveError>
Admit an authored [x, y, z, w] quaternion under C02-C04 (|norm_sq - 1| <= 1e-12).
Never mutates raw_xyzw; computes derived q_i / sqrt(n2) without fused multiply-add.
Sourcepub fn compose(&self, local: &Self) -> Result<Self, ConstitutiveError>
pub fn compose(&self, local: &Self) -> Result<Self, ConstitutiveError>
Compose self (parent) with local (q_parent * q_local = apply local then parent).
Sourcepub fn rotate_vector(&self, v_local: [f64; 3]) -> [f64; 3]
pub fn rotate_vector(&self, v_local: [f64; 3]) -> [f64; 3]
Active vector transformation $v_{\text{parent}} = R(q),v_{\text{local}}$.
Sourcepub fn rotate_tensor_real(&self, t_local: &[[f64; 3]; 3]) -> [[f64; 3]; 3]
pub fn rotate_tensor_real(&self, t_local: &[[f64; 3]; 3]) -> [[f64; 3]; 3]
Active rank-2 real tensor transformation $T_{\text{parent}} = R(q),T_{\text{local}},R(q)^T$.
Sourcepub fn rotate_tensor_complex(
&self,
t_local: &[[Complex64; 3]; 3],
) -> [[Complex64; 3]; 3]
pub fn rotate_tensor_complex( &self, t_local: &[[Complex64; 3]; 3], ) -> [[Complex64; 3]; 3]
Active rank-2 complex tensor transformation $T_{\text{parent}} = R(q),T_{\text{local}},R(q)^T$.
Sourcepub fn orthogonality_residual(&self) -> f64
pub fn orthogonality_residual(&self) -> f64
Maximum absolute residual $|R R^T - I|_{\max}$.
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
Determinant $\det(R)$ (proper rotation has $+1.0$).
Trait Implementations§
Source§impl Clone for ActiveHamiltonRotation
impl Clone for ActiveHamiltonRotation
impl Copy for ActiveHamiltonRotation
Source§impl Debug for ActiveHamiltonRotation
impl Debug for ActiveHamiltonRotation
Source§impl PartialEq for ActiveHamiltonRotation
impl PartialEq for ActiveHamiltonRotation
impl StructuralPartialEq for ActiveHamiltonRotation
Auto Trait Implementations§
impl Freeze for ActiveHamiltonRotation
impl RefUnwindSafe for ActiveHamiltonRotation
impl Send for ActiveHamiltonRotation
impl Sync for ActiveHamiltonRotation
impl Unpin for ActiveHamiltonRotation
impl UnsafeUnpin for ActiveHamiltonRotation
impl UnwindSafe for ActiveHamiltonRotation
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more