Struct vecmat::Quaternion[][src]

#[repr(transparent)]pub struct Quaternion<T> { /* fields omitted */ }

Quaternion.

Implementations

impl<T> Quaternion<T>[src]

pub fn new(w: T, x: T, y: T, z: T) -> Self[src]

pub fn from_vector(vec: Vector4<T>) -> Self[src]

pub fn from_array(arr: [T; 4]) -> Self[src]

pub fn from_tuple(tup: (T, T, T, T)) -> Self[src]

pub fn from_scalar_and_vector3(w: T, vec: Vector3<T>) -> Self[src]

pub fn into_vector(self) -> Vector4<T>[src]

pub fn into_array(self) -> [T; 4][src]

pub fn into_tuple(self) -> (T, T, T, T)[src]

pub fn into_scalar_and_vector3(self) -> (T, Vector3<T>)[src]

impl<T> Quaternion<T> where
    T: Copy
[src]

pub fn w(&self) -> T[src]

pub fn x(&self) -> T[src]

pub fn y(&self) -> T[src]

pub fn z(&self) -> T[src]

pub fn xyz(&self) -> Vector3<T>[src]

impl<T> Quaternion<T>[src]

pub fn w_ref(&self) -> &T[src]

pub fn x_ref(&self) -> &T[src]

pub fn y_ref(&self) -> &T[src]

pub fn z_ref(&self) -> &T[src]

pub fn w_mut(&mut self) -> &mut T[src]

pub fn x_mut(&mut self) -> &mut T[src]

pub fn y_mut(&mut self) -> &mut T[src]

pub fn z_mut(&mut self) -> &mut T[src]

impl<T> Quaternion<T> where
    T: Neg<Output = T> + Copy
[src]

pub fn into_matrix(self) -> Matrix4x4<T>[src]

impl<T> Quaternion<T> where
    T: Neg<Output = T>, 
[src]

pub fn conj(self) -> Self[src]

impl<T> Quaternion<T> where
    T: Zero + One
[src]

pub fn i() -> Self[src]

pub fn j() -> Self[src]

pub fn k() -> Self[src]

impl<T> Quaternion<T> where
    T: Add<Output = T> + Mul<Output = T> + Copy
[src]

pub fn norm_sqr(self) -> T[src]

impl<T: Float> Quaternion<T>[src]

pub fn norm(self) -> T[src]

impl<T> Quaternion<T> where
    T: Float
[src]

pub fn normalize(self) -> Self[src]

impl<T> Quaternion<T> where
    T: Neg<Output = T> + Num + Copy
[src]

pub fn inv(self) -> Self[src]

Trait Implementations

impl<T> AbsDiffEq<Quaternion<T>> for Quaternion<T> where
    T: AbsDiffEq<Epsilon = T> + Copy
[src]

type Epsilon = T

Used for specifying relative comparisons.

impl<T> Add<Complex<T>> for Quaternion<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> Add<Quaternion<T>> for Quaternion<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl Add<Quaternion<f32>> for Complex<f32>[src]

Workaround for reverse addition.

type Output = Quaternion<f32>

The resulting type after applying the + operator.

impl Add<Quaternion<f64>> for Complex<f64>[src]

Workaround for reverse addition.

type Output = Quaternion<f64>

The resulting type after applying the + operator.

impl<T> Add<T> for Quaternion<T> where
    T: Add<Output = T>, 
[src]

type Output = Self

The resulting type after applying the + operator.

impl<T> AddAssign<Complex<T>> for Quaternion<T> where
    T: AddAssign
[src]

impl<T> AddAssign<Quaternion<T>> for Quaternion<T> where
    T: AddAssign
[src]

impl<T> AddAssign<T> for Quaternion<T> where
    T: AddAssign
[src]

impl<T: Clone> Clone for Quaternion<T>[src]

impl<T> Conj for Quaternion<T> where
    T: Neg<Output = T>, 
[src]

impl<T: Copy> Copy for Quaternion<T>[src]

impl<T: Debug> Debug for Quaternion<T>[src]

impl<T: Display> Display for Quaternion<T>[src]

impl<T> Distribution<Quaternion<T>> for Normal where
    Normal: Distribution<Vector<T, 4>>, 
[src]

impl<T: Float> Distribution<Quaternion<T>> for NonZero where
    NonZero: Distribution<Vector<T, 4>>, 
[src]

impl<T: Float> Distribution<Quaternion<T>> for Unit where
    Unit: Distribution<Vector<T, 4>>, 
[src]

impl<T> Div<Complex<T>> for Quaternion<T> where
    T: Neg<Output = T> + Num + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T> Div<Quaternion<T>> for Quaternion<T> where
    T: Neg<Output = T> + Num + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T> Div<Quaternion<T>> for Complex<T> where
    T: Neg<Output = T> + Num + Copy
[src]

type Output = Quaternion<T>

The resulting type after applying the / operator.

impl<T> Div<T> for Quaternion<T> where
    T: Div<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the / operator.

impl<T> DivAssign<Complex<T>> for Quaternion<T> where
    Self: Div<Complex<T>, Output = Self> + Copy
[src]

impl<T> DivAssign<Quaternion<T>> for Quaternion<T> where
    Self: Div<Output = Self> + Copy
[src]

impl<T> DivAssign<T> for Quaternion<T> where
    Self: Div<T, Output = Self> + Copy
[src]

impl<T> Dot<Quaternion<T>> for Quaternion<T> where
    T: Add<Output = T> + Mul<Output = T>, 
[src]

type Output = T

Dot product output type.

impl<T> From<[T; 4]> for Quaternion<T>[src]

impl<T> From<(T, T, T, T)> for Quaternion<T>[src]

impl<T> From<(T, Vector<T, 3_usize>)> for Quaternion<T>[src]

impl<T> From<Quaternion<T>> for Vector4<T>[src]

impl<T> From<Quaternion<T>> for Rotation3<T>[src]

impl<T> From<Rotation3<T>> for Quaternion<T>[src]

impl<T> From<Vector<T, 4_usize>> for Quaternion<T>[src]

impl<T> Mul<Complex<T>> for Quaternion<T> where
    T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> Mul<Quaternion<T>> for Quaternion<T> where
    T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> Mul<Quaternion<T>> for Complex<T> where
    T: Add<Output = T> + Sub<Output = T> + Mul<Output = T> + Copy
[src]

type Output = Quaternion<T>

The resulting type after applying the * operator.

impl<T> Mul<T> for Quaternion<T> where
    T: Mul<Output = T> + Copy
[src]

type Output = Self

The resulting type after applying the * operator.

impl<T> MulAssign<Complex<T>> for Quaternion<T> where
    Self: Mul<Complex<T>, Output = Self> + Copy
[src]

impl<T> MulAssign<Quaternion<T>> for Quaternion<T> where
    Self: Mul<Output = Self> + Copy
[src]

impl<T> MulAssign<T> for Quaternion<T> where
    Self: Mul<T, Output = Self> + Copy
[src]

impl<T> Neg for Quaternion<T> where
    T: Neg<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> NormL1 for Quaternion<T> where
    Vector4<T>: NormL1<Output = T>, 
[src]

type Output = T

Type of the norm.

impl<T: Float> NormL2 for Quaternion<T>[src]

type Output = T

Type of the norm.

impl<T: Neg<Output = T> + Num + Copy> Num for Quaternion<T>[src]

type FromStrRadixErr = T::FromStrRadixErr

impl<T> One for Quaternion<T> where
    T: Zero + One + Sub<Output = T> + Copy
[src]

impl<T: PartialEq> PartialEq<Quaternion<T>> for Quaternion<T>[src]

impl<T: Neg<Output = T> + Num + Copy> Rem<Quaternion<T>> for Quaternion<T>[src]

type Output = Self

The resulting type after applying the % operator.

impl<T> StructuralPartialEq for Quaternion<T>[src]

impl<T> Sub<Complex<T>> for Quaternion<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> Sub<Quaternion<T>> for Quaternion<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl Sub<Quaternion<f32>> for Complex<f32>[src]

Workaround for reverse subtraction.

type Output = Quaternion<f32>

The resulting type after applying the - operator.

impl Sub<Quaternion<f64>> for Complex<f64>[src]

Workaround for reverse subtraction.

type Output = Quaternion<f64>

The resulting type after applying the - operator.

impl<T> Sub<T> for Quaternion<T> where
    T: Sub<Output = T>, 
[src]

type Output = Self

The resulting type after applying the - operator.

impl<T> SubAssign<Complex<T>> for Quaternion<T> where
    T: SubAssign
[src]

impl<T> SubAssign<Quaternion<T>> for Quaternion<T> where
    T: SubAssign
[src]

impl<T> SubAssign<T> for Quaternion<T> where
    T: SubAssign
[src]

impl<T> Zero for Quaternion<T> where
    T: Zero
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Quaternion<T> where
    T: RefUnwindSafe

impl<T> Send for Quaternion<T> where
    T: Send

impl<T> Sync for Quaternion<T> where
    T: Sync

impl<T> Unpin for Quaternion<T> where
    T: Unpin

impl<T> UnwindSafe for Quaternion<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Rhs, Output> NumOps<Rhs, Output> for T where
    T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,