pub type Quaternion<T> = (T, Vector3<T>);Expand description
Quaternion
The type (q0, [q1, q2, q3]) is equivalent to the expression q0 + q1i + q2j + q3k,
where 1, i, j, k are basis of quaternions and satisfy the following equality:
i^2 = j^2 = k^2 = ijk = -1
Trait Implementations§
Source§impl<T: Float> QuaternionOps<T> for Quaternion<T>
impl<T: Float> QuaternionOps<T> for Quaternion<T>
fn sum(self) -> T
Source§fn add(self, rhs: Quaternion<T>) -> Quaternion<T>
fn add(self, rhs: Quaternion<T>) -> Quaternion<T>
self + rhsSource§fn sub(self, rhs: Quaternion<T>) -> Quaternion<T>
fn sub(self, rhs: Quaternion<T>) -> Quaternion<T>
self - rhsSource§fn scale(self, s: T) -> Quaternion<T>
fn scale(self, s: T) -> Quaternion<T>
s * selfSource§fn scale_add(self, s: T, b: Quaternion<T>) -> Quaternion<T>
fn scale_add(self, s: T, b: Quaternion<T>) -> Quaternion<T>
s * self + bSource§fn hadamard(self, rhs: Quaternion<T>) -> Quaternion<T>
fn hadamard(self, rhs: Quaternion<T>) -> Quaternion<T>
self ∘ rhsSource§fn hadamard_add(self, b: Quaternion<T>, c: Quaternion<T>) -> Quaternion<T>
fn hadamard_add(self, b: Quaternion<T>, c: Quaternion<T>) -> Quaternion<T>
self ∘ b + cfn dot(self, b: Quaternion<T>) -> T
fn norm(self) -> T
Source§fn negate(self) -> Quaternion<T>
fn negate(self) -> Quaternion<T>
-selfSource§fn mul(self, rhs: Quaternion<T>) -> Quaternion<T>
fn mul(self, rhs: Quaternion<T>) -> Quaternion<T>
self * rhs