Struct nalgebra::geometry::QuaternionBase [] [src]

#[repr(C)]
pub struct QuaternionBase<N: Real, S: Storage<N, U4, U1>> { pub coords: ColumnVector<N, U4, S>, }

A quaternion. See the type alias UnitQuaternionBase = Unit<QuaternionBase> for a quaternion that may be used as a rotation.

Fields

This quaternion as a 4D vector of coordinates in the [ x, y, z, w ] storage order.

Methods

impl<N, S> QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

Moves this quaternion into one that owns its data.

Clones this quaternion into one that owns its data.

The vector part (i, j, k) of this quaternion.

The scalar part w of this quaternion.

Reinterprets this quaternion as a 4D vector.

The norm of this quaternion.

The squared norm of this quaternion.

Normalizes this quaternion.

Compute the conjugate of this quaternion.

Inverts this quaternion if it is not zero.

Linear interpolation between two quaternion.

impl<N, S> QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>,
    S::Alloc: Allocator<N, U3, U1>, 
[src]

The polar decomposition of this quaternion.

Returns, from left to right: the quaternion norm, the half rotation angle, the rotation axis. If the rotation angle is zero, the rotation axis is set to None.

Compute the exponential of a quaternion.

Compute the natural logarithm of a quaternion.

Raise the quaternion to a given floating power.

impl<N, S> QuaternionBase<N, S> where
    N: Real,
    S: StorageMut<N, U4, U1>, 
[src]

Transforms this quaternion into its 4D vector form (Vector part, Scalar part).

The mutable vector part (i, j, k) of this quaternion.

Replaces this quaternion by its conjugate.

Inverts this quaternion in-place if it is not zero.

Normalizes this quaternion.

impl<N, S> QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

Creates a quaternion from a 4D vector. The quaternion scalar part corresponds to the w vector component.

impl<N, S> QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Creates a new quaternion from its individual components. Note that the arguments order does not follow the storage order.

The storage order is [ x, y, z, w ].

Creates a new quaternion from its scalar and vector parts. Note that the arguments order does not follow the storage order.

The storage order is [ vector, scalar ].

Creates a new quaternion from its polar decomposition.

Note that axis is assumed to be a unit vector.

The quaternion multiplicative identity.

Trait Implementations

impl<N: Hash + Real, S: Hash + Storage<N, U4, U1>> Hash for QuaternionBase<N, S>
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl<N: Debug + Real, S: Debug + Storage<N, U4, U1>> Debug for QuaternionBase<N, S>
[src]

Formats the value using the given formatter.

impl<N: Copy + Real, S: Copy + Storage<N, U4, U1>> Copy for QuaternionBase<N, S>
[src]

impl<N: Clone + Real, S: Clone + Storage<N, U4, U1>> Clone for QuaternionBase<N, S>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N, S> Eq for QuaternionBase<N, S> where
    N: Real + Eq,
    S: Storage<N, U4, U1>, 
[src]

impl<N, S> PartialEq for QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<N, S> ApproxEq for QuaternionBase<N, S> where
    N: Real + ApproxEq<Epsilon = N>,
    S: Storage<N, U4, U1>, 
[src]

Used for specifying relative comparisons.

The default tolerance to use when testing values that are close together. Read more

The default relative tolerance for testing values that are far-apart. Read more

The default ULPs to tolerate when testing values that are far-apart. Read more

A test for equality that uses a relative comparison if the values are far apart.

A test for equality that uses units in the last place (ULP) if the values are far apart.

The inverse of ApproxEq::relative_eq.

The inverse of ApproxEq::ulps_eq.

impl<N, S> Display for QuaternionBase<N, S> where
    N: Real + Display,
    S: Storage<N, U4, U1>, 
[src]

Formats the value using the given formatter. Read more

impl<N, S> One for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns the multiplicative identity element of Self, 1. Read more

impl<N, S> Zero for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns the additive identity element of Self, 0. Read more

Returns true if self is equal to the additive identity.

impl<N, S> Rand for QuaternionBase<N, S> where
    N: Real + Rand,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Generates a random instance of this type using the specified source of randomness. Read more

impl<N, S> Index<usize> for QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The returned type after indexing

The method for the indexing (container[index]) operation

impl<N, S> IndexMut<usize> for QuaternionBase<N, S> where
    N: Real,
    S: StorageMut<N, U4, U1>, 
[src]

The method for the mutable indexing (container[index]) operation

impl<'a, 'b, N, SA, SB> Add<&'b QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, N, SA, SB> Add<QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'b, N, SA, SB> Add<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the + operator

The method for the + operator

impl<N, SA, SB> Add<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b, N, SA, SB> Sub<&'b QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, N, SA, SB> Sub<QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'b, N, SA, SB> Sub<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the - operator

The method for the - operator

impl<N, SA, SB> Sub<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, 'b, N, SA, SB> Mul<&'b QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'a, N, SA, SB> Mul<QuaternionBase<N, SB>> for &'a QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'b, N, SA, SB> Mul<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the * operator

The method for the * operator

impl<N, SA, SB> Mul<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: Storage<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The resulting type after applying the * operator

The method for the * operator

impl<N, S> Mul<N> for QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'a, N, S> Mul<N> for &'a QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The resulting type after applying the * operator

The method for the * operator

impl<N, S> MulAssign<N> for QuaternionBase<N, S> where
    N: Real,
    S: StorageMut<N, U4, U1>, 
[src]

The method for the *= operator

impl<N, S> Div<N> for QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, N, S> Div<N> for &'a QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The resulting type after applying the / operator

The method for the / operator

impl<N, S> DivAssign<N> for QuaternionBase<N, S> where
    N: Real,
    S: StorageMut<N, U4, U1>, 
[src]

The method for the /= operator

impl<N, S> Neg for QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<'a, N, S> Neg for &'a QuaternionBase<N, S> where
    N: Real,
    S: Storage<N, U4, U1>, 
[src]

The resulting type after applying the - operator

The method for the unary - operator

impl<'b, N, SA, SB> AddAssign<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: StorageMut<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The method for the += operator

impl<N, SA, SB> AddAssign<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: StorageMut<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The method for the += operator

impl<'b, N, SA, SB> SubAssign<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: StorageMut<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The method for the -= operator

impl<N, SA, SB> SubAssign<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: StorageMut<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The method for the -= operator

impl<'b, N, SA, SB> MulAssign<&'b QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: StorageMut<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The method for the *= operator

impl<N, SA, SB> MulAssign<QuaternionBase<N, SB>> for QuaternionBase<N, SA> where
    N: Real,
    SA: StorageMut<N, U4, U1>,
    SB: Storage<N, U4, U1>, 
[src]

The method for the *= operator

impl<N, S> Identity<Multiplicative> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The identity element.

impl<N, S> Identity<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The identity element.

impl<N, S> AbstractMagma<Multiplicative> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Performs an operation.

Performs specific operation.

impl<N, S> AbstractMagma<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Performs an operation.

Performs specific operation.

impl<N, S> Inverse<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns the inverse of self, relative to the operator O.

In-place inversin of self.

impl<N, S> AbstractSemigroup<Multiplicative> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns true if associativity holds for the given arguments. Approximate equality is used for verifications. Read more

Returns true if associativity holds for the given arguments.

impl<N, S> AbstractMonoid<Multiplicative> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more

Checks whether operating with the identity element is a no-op for the given argument. Read more

impl<N, S> AbstractSemigroup<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns true if associativity holds for the given arguments. Approximate equality is used for verifications. Read more

Returns true if associativity holds for the given arguments.

impl<N, S> AbstractQuasigroup<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns true if latin squareness holds for the given arguments. Approximate equality is used for verifications. Read more

Returns true if latin squareness holds for the given arguments.

impl<N, S> AbstractMonoid<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Checks whether operating with the identity element is a no-op for the given argument. Approximate equality is used for verifications. Read more

Checks whether operating with the identity element is a no-op for the given argument. Read more

impl<N, S> AbstractLoop<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

impl<N, S> AbstractGroup<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

impl<N, S> AbstractGroupAbelian<Additive> for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

Returns true if the operator is commutative for the given argument tuple. Approximate equality is used for verifications. Read more

Returns true if the operator is commutative for the given argument tuple.

impl<N, S> AbstractModule for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The underlying scalar field.

Multiplies an element of the ring with an element of the module.

impl<N, S> Module for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The underlying scalar field.

impl<N, S> VectorSpace for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The underlying scalar field.

impl<N, S> FiniteDimVectorSpace for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The vector space dimension.

The i-the canonical basis element.

The dot product between two vectors.

Same as &self[i] but without bound-checking.

Same as &mut self[i] but without bound-checking.

Applies the given closule to each element of this vector space's canonical basis. Stops if f returns false. Read more

impl<N, S> NormedSpace for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The squared norm of this vector.

The norm of this vector.

Returns a normalized version of this vector.

Normalizes this vector in-place and returns its norm.

Returns a normalized version of this vector unless its norm as smaller or equal to eps.

Normalizes this vector in-place or does nothing if its norm is smaller or equal to eps. Read more

impl<N, S> Deref for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<N, S> DerefMut for QuaternionBase<N, S> where
    N: Real,
    S: OwnedStorage<N, U4, U1>,
    S::Alloc: OwnedAllocator<N, U4, U1, S>, 
[src]

The method called to mutably dereference a value

impl<N1, N2, SA, SB> SubsetOf<QuaternionBase<N2, SB>> for QuaternionBase<N1, SA> where
    N1: Real,
    N2: Real + SupersetOf<N1>,
    SA: OwnedStorage<N1, U4, U1>,
    SB: OwnedStorage<N2, U4, U1>,
    SA::Alloc: OwnedAllocator<N1, U4, U1, SA>,
    SB::Alloc: OwnedAllocator<N2, U4, U1, SB>, 
[src]

The inclusion map: converts self to the equivalent element of its superset.

Checks if element is actually part of the subset Self (and can be converted to it).

Use with care! Same as self.to_superset but without any property checks. Always succeeds.

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more