[][src]Struct static_math::quaternion::Quaternion

pub struct Quaternion<T> {
    pub q0: T,
    pub q: V3<T>,
}

Quaternion type

Fields

q0: T

Scalar part

q: V3<T>

Imaginary part

Implementations

impl<T> Quaternion<T>[src]

pub fn new(q0: T, q: V3<T>) -> Self[src]

pub fn new_from(q0: T, q1: T, q2: T, q3: T) -> Self[src]

impl<T: Num + Copy> Quaternion<T>[src]

pub fn dot(&self, rhs: Self) -> T[src]

impl<T: Num + Copy + Signed> Quaternion<T>[src]

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

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

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

normalize the Quaternion

pub fn rotation(theta: T, v: V3<T>) -> Self[src]

generate a Quaternion that represents a rotation of a angle theta around the axis(normalized) v

pub fn rotation_norm_encoded(v: V3<T>) -> Self[src]

generate a Quaternion that represents a rotation of a angle theta around the axis(normalized) v, the angle theta is encoded in the norm of the vector v

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

pub fn get_axis(&self) -> Option<V3<T>>[src]

Trait Implementations

impl<T: Num + Copy> Add<Quaternion<T>> for Quaternion<T>[src]

type Output = Self

The resulting type after applying the + operator.

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

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

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

impl<T: Num + Copy> Div<T> for Quaternion<T>[src]

type Output = Self

The resulting type after applying the / operator.

impl<T: Num + Copy> Mul<Quaternion<T>> for Quaternion<T>[src]

type Output = Self

The resulting type after applying the * operator.

impl<T: Num + Copy + Signed> Mul<V3<T>> for Quaternion<T>[src]

type Output = V3<T>

The resulting type after applying the * operator.

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

type Output = Self

The resulting type after applying the - operator.

impl<T: Num + Copy> Sub<Quaternion<T>> for Quaternion<T>[src]

type Output = Self

The resulting type after applying the - operator.

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.