Trait Quaternion

Source
pub trait Quaternion {
Show 16 methods // Required methods fn as_ptr_mut(&mut self) -> *mut f64; fn as_ptr(&self) -> *const f64; fn prec_eq(&self, e: f64, q: [f64; 4]) -> bool; fn as_vec(&self) -> ODEMat<'_>; // Provided methods fn new() -> [f64; 4] { ... } fn from_R(m: [f64; 12]) -> [f64; 4] { ... } fn to_R(&self) -> [f64; 12] { ... } fn from_axis_and_angle(axis: [f64; 3], angle: f64) -> [f64; 4] { ... } fn multiply0(p: [f64; 4], q: [f64; 4]) -> [f64; 4] { ... } fn multiply0_pp(p: *const f64, q: *const f64) -> [f64; 4] { ... } fn multiply0_331(m: [f64; 12], v: [f64; 4]) -> [f64; 4] { ... } fn multiply0_331_pp(m: *const f64, v: *const f64) -> [f64; 4] { ... } fn multiply0_441(m: [f64; 16], v: [f64; 4]) -> [f64; 4] { ... } fn multiply0_441_pp(m: *const f64, v: *const f64) -> [f64; 4] { ... } fn conjugate(q: [f64; 4]) -> [f64; 4] { ... } fn conjugate_ptr(q: *const f64) -> [f64; 4] { ... }
}
Expand description

constructor and converter for primitive type

Required Methods§

Source

fn as_ptr_mut(&mut self) -> *mut f64

ptr mut of dQuaternion

Source

fn as_ptr(&self) -> *const f64

ptr of dQuaternion (use for converter)

Source

fn prec_eq(&self, e: f64, q: [f64; 4]) -> bool

check equal with precision

Source

fn as_vec(&self) -> ODEMat<'_>

for Debug

Provided Methods§

Source

fn new() -> [f64; 4]

construct as Identity

Source

fn from_R(m: [f64; 12]) -> [f64; 4]

constructor (converter)

Source

fn to_R(&self) -> [f64; 12]

converter (like as dMatrix3::from_Q(*self))

Source

fn from_axis_and_angle(axis: [f64; 3], angle: f64) -> [f64; 4]

constructor axis [x, y, z] should be norm == 1, angle is theta radian Q(axis, angle) == [cos(t/2), xsin(t/2), ysin(t/2), zsin(t/2)]

Source

fn multiply0(p: [f64; 4], q: [f64; 4]) -> [f64; 4]

constructor multiply p: dQuaternion and q: dQuaternion

Source

fn multiply0_pp(p: *const f64, q: *const f64) -> [f64; 4]

constructor multiply p: dQuaternion pointer and q: dQuaternion pointer

Source

fn multiply0_331(m: [f64; 12], v: [f64; 4]) -> [f64; 4]

constructor multiply m: dMatrix3 and v: dVector3 dVector3::multiply0_331 is defined as dQuaternion::multiply0_331

Source

fn multiply0_331_pp(m: *const f64, v: *const f64) -> [f64; 4]

constructor multiply m: dMatrix3 pointer and v: dVector3 pointer dVector3::multiply0_331_pp is defined as dQuaternion::multiply0_331_pp

Source

fn multiply0_441(m: [f64; 16], v: [f64; 4]) -> [f64; 4]

constructor multiply m: dMatrix4 and v: dVector4 dVector4::multiply0_441 is defined as dQuaternion::multiply0_441

Source

fn multiply0_441_pp(m: *const f64, v: *const f64) -> [f64; 4]

constructor multiply m: dMatrix4 pointer and v: dVector4 pointer dVector4::multiply0_441_pp is defined as dQuaternion::multiply0_441_pp

Source

fn conjugate(q: [f64; 4]) -> [f64; 4]

conjugate dQuaternion

Source

fn conjugate_ptr(q: *const f64) -> [f64; 4]

conjugate dQuaternion pointer

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Quaternion for [f64; 4]

Source§

fn as_ptr_mut(&mut self) -> *mut f64

ptr mut of dQuaternion

Source§

fn as_ptr(&self) -> *const f64

ptr of dQuaternion (use for converter)

Source§

fn prec_eq(&self, e: f64, q: [f64; 4]) -> bool

check equal with precision

Source§

fn as_vec(&self) -> ODEMat<'_>

for Debug

Implementors§