pub struct QuaternionXyzw {
pub x: f64,
pub y: f64,
pub z: f64,
pub w: f64,
}Expand description
Active right-handed Hamilton unit quaternion [x, y, z, w] (q * p * q*).
Norm admission uses the exact f64 evaluation order specified in quantities-models.md:
abs((((x*x + y*y) + z*z) + w*w) - 1.0) <= 1e-12 without silent normalization.
Fields§
§x: f64§y: f64§z: f64§w: f64Implementations§
Source§impl QuaternionXyzw
impl QuaternionXyzw
pub const IDENTITY: Self
pub fn from_xyzw(xyzw: [f64; 4]) -> Result<Self, ProfileError>
pub fn from_axis_angle( axis: [f64; 3], angle_rad: f64, ) -> Result<Self, ProfileError>
Sourcepub fn normalized_for_derived_use(self) -> [f64; 4]
pub fn normalized_for_derived_use(self) -> [f64; 4]
Derived unit quaternion (q / norm(q)) for floating-point matrix algebra.
pub fn inverse(self) -> Self
Sourcepub fn rotation_matrix(self) -> [[f64; 3]; 3]
pub fn rotation_matrix(self) -> [[f64; 3]; 3]
Active 3x3 orthogonal rotation matrix R in row-major order.
pub fn rotate_vec3(self, v: [f64; 3]) -> [f64; 3]
Trait Implementations§
Source§impl Clone for QuaternionXyzw
impl Clone for QuaternionXyzw
impl Copy for QuaternionXyzw
Source§impl Debug for QuaternionXyzw
impl Debug for QuaternionXyzw
Source§impl PartialEq for QuaternionXyzw
impl PartialEq for QuaternionXyzw
impl StructuralPartialEq for QuaternionXyzw
Auto Trait Implementations§
impl Freeze for QuaternionXyzw
impl RefUnwindSafe for QuaternionXyzw
impl Send for QuaternionXyzw
impl Sync for QuaternionXyzw
impl Unpin for QuaternionXyzw
impl UnsafeUnpin for QuaternionXyzw
impl UnwindSafe for QuaternionXyzw
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>,
Aggregate shares in an MPC protocol.
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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