Struct nalgebra::geometry::Quaternion[][src]

#[repr(C)]
pub struct Quaternion<N: Real> { pub coords: Vector4<N>, }

A quaternion. See the type alias UnitQuaternion = Unit<Quaternion> 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: Real> Quaternion<N>
[src]

Deprecated

: This method is a no-op and will be removed in a future release.

Moves this unit quaternion into one that owns its data.

Deprecated

: This method is a no-op and will be removed in a future release.

Clones this unit quaternion into one that owns its data.

Normalizes this quaternion.

Compute the conjugate of this quaternion.

Inverts this quaternion if it is not zero.

Linear interpolation between two quaternion.

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.

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 exponential of a quaternion.

Compute the natural logarithm of a quaternion.

Raise the quaternion to a given floating power.

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: Real> Quaternion<N>
[src]

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

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: Debug + Real> Debug for Quaternion<N>
[src]

Formats the value using the given formatter. Read more

impl<N: Real + Eq> Eq for Quaternion<N>
[src]

impl<N: Real> PartialEq for Quaternion<N>
[src]

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

This method tests for !=.

impl<N: Real + Hash> Hash for Quaternion<N>
[src]

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

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

impl<N: Real> Copy for Quaternion<N>
[src]

impl<N: Real> Clone for Quaternion<N>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N: Real + AbsDiffEq<Epsilon = N>> AbsDiffEq for Quaternion<N>
[src]

Used for specifying relative comparisons.

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

A test for equality that uses the absolute difference to compute the approximate equality of two numbers. Read more

The inverse of ApproxEq::abs_diff_eq.

impl<N: Real + RelativeEq<Epsilon = N>> RelativeEq for Quaternion<N>
[src]

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

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

The inverse of ApproxEq::relative_eq.

impl<N: Real + UlpsEq<Epsilon = N>> UlpsEq for Quaternion<N>
[src]

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

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

The inverse of ApproxEq::ulps_eq.

impl<N: Real + Display> Display for Quaternion<N>
[src]

Formats the value using the given formatter. Read more

impl<N: Real> One for Quaternion<N>
[src]

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

Returns true if self is equal to the multiplicative identity. Read more

impl<N: Real> Zero for Quaternion<N>
[src]

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

Returns true if self is equal to the additive identity.

impl<N: Real> Distribution<Quaternion<N>> for Standard where
    Standard: Distribution<N>, 
[src]

Generate a random value of T, using rng as the source of randomness.

Important traits for DistIter<'a, D, R, T>

Create an iterator that generates random values of T, using rng as the source of randomness. Read more

impl<N: Real> Index<usize> for Quaternion<N>
[src]

The returned type after indexing.

Important traits for &'a mut R

Performs the indexing (container[index]) operation.

impl<N: Real> IndexMut<usize> for Quaternion<N>
[src]

Important traits for &'a mut R

Performs the mutable indexing (container[index]) operation.

impl<'a, 'b, N: Real> Add<&'b Quaternion<N>> for &'a Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'a, N: Real> Add<Quaternion<N>> for &'a Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'b, N: Real> Add<&'b Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<N: Real> Add<Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the + operator.

Performs the + operation.

impl<'a, 'b, N: Real> Sub<&'b Quaternion<N>> for &'a Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<'a, N: Real> Sub<Quaternion<N>> for &'a Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<'b, N: Real> Sub<&'b Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<N: Real> Sub<Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the - operator.

Performs the - operation.

impl<'a, 'b, N: Real> Mul<&'b Quaternion<N>> for &'a Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, N: Real> Mul<Quaternion<N>> for &'a Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'b, N: Real> Mul<&'b Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<N: Real> Mul<Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<N: Real> Mul<N> for Quaternion<N>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'a, N: Real> Mul<N> for &'a Quaternion<N>
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<N: Real> MulAssign<N> for Quaternion<N>
[src]

Performs the *= operation.

impl<N: Real> Div<N> for Quaternion<N>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<'a, N: Real> Div<N> for &'a Quaternion<N>
[src]

The resulting type after applying the / operator.

Performs the / operation.

impl<N: Real> DivAssign<N> for Quaternion<N>
[src]

Performs the /= operation.

impl Mul<Quaternion<f32>> for f32
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'b> Mul<&'b Quaternion<f32>> for f32
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl Mul<Quaternion<f64>> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<'b> Mul<&'b Quaternion<f64>> for f64
[src]

The resulting type after applying the * operator.

Performs the * operation.

impl<N: Real> Neg for Quaternion<N>
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<'a, N: Real> Neg for &'a Quaternion<N>
[src]

The resulting type after applying the - operator.

Performs the unary - operation.

impl<'b, N: Real> AddAssign<&'b Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

Performs the += operation.

impl<N: Real> AddAssign<Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

Performs the += operation.

impl<'b, N: Real> SubAssign<&'b Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

Performs the -= operation.

impl<N: Real> SubAssign<Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

Performs the -= operation.

impl<'b, N: Real> MulAssign<&'b Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

Performs the *= operation.

impl<N: Real> MulAssign<Quaternion<N>> for Quaternion<N> where
    DefaultAllocator: Allocator<N, U4, U1> + Allocator<N, U4, U1>, 
[src]

Performs the *= operation.

impl<N: Real> Identity<Multiplicative> for Quaternion<N>
[src]

The identity element.

Specific identity.

impl<N: Real> Identity<Additive> for Quaternion<N>
[src]

The identity element.

Specific identity.

impl<N: Real> AbstractMagma<Multiplicative> for Quaternion<N>
[src]

Performs an operation.

Performs specific operation.

impl<N: Real> AbstractMagma<Additive> for Quaternion<N>
[src]

Performs an operation.

Performs specific operation.

impl<N: Real> Inverse<Additive> for Quaternion<N>
[src]

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

In-place inversin of self.

impl<N: Real> AbstractSemigroup<Multiplicative> for Quaternion<N>
[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: Real> AbstractMonoid<Multiplicative> for Quaternion<N>
[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: Real> AbstractSemigroup<Additive> for Quaternion<N>
[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: Real> AbstractQuasigroup<Additive> for Quaternion<N>
[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: Real> AbstractMonoid<Additive> for Quaternion<N>
[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: Real> AbstractLoop<Additive> for Quaternion<N>
[src]

impl<N: Real> AbstractGroup<Additive> for Quaternion<N>
[src]

impl<N: Real> AbstractGroupAbelian<Additive> for Quaternion<N>
[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: Real> AbstractModule for Quaternion<N>
[src]

The underlying scalar field.

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

impl<N: Real> Module for Quaternion<N>
[src]

The underlying scalar field.

impl<N: Real> VectorSpace for Quaternion<N>
[src]

The underlying scalar field.

impl<N: Real> FiniteDimVectorSpace for Quaternion<N>
[src]

The vector space dimension.

The i-the canonical basis element.

The dot product between two vectors.

Important traits for &'a mut R

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

Important traits for &'a mut R

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: Real> NormedSpace for Quaternion<N>
[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<N1, N2> SubsetOf<Quaternion<N2>> for Quaternion<N1> where
    N1: Real,
    N2: Real + SupersetOf<N1>, 
[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

impl<N: Real> Deref for Quaternion<N>
[src]

The resulting type after dereferencing.

Dereferences the value.

impl<N: Real> DerefMut for Quaternion<N>
[src]

Mutably dereferences the value.

Auto Trait Implementations

impl<N> Send for Quaternion<N>

impl<N> Sync for Quaternion<N>