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]

[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.

[src]

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.

[src]

Normalizes this quaternion.

[src]

Compute the conjugate of this quaternion.

[src]

Inverts this quaternion if it is not zero.

[src]

Linear interpolation between two quaternion.

[src]

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

[src]

The scalar part w of this quaternion.

[src]

Reinterprets this quaternion as a 4D vector.

[src]

The norm of this quaternion.

[src]

The squared norm of this quaternion.

[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.

[src]

Compute the exponential of a quaternion.

[src]

Compute the exponential of a quaternion.

[src]

Compute the natural logarithm of a quaternion.

[src]

Raise the quaternion to a given floating power.

[src]

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

[src]

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

[src]

Replaces this quaternion by its conjugate.

[src]

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

[src]

Normalizes this quaternion.

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

[src]

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

[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 ].

[src]

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 ].

[src]

Creates a new quaternion from its polar decomposition.

Note that axis is assumed to be a unit vector.

[src]

The quaternion multiplicative identity.

Trait Implementations

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

[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]

[src]

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

1.0.0
[src]

This method tests for !=.

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

[src]

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

1.3.0
[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

Used for specifying relative comparisons.

[src]

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

[src]

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

[src]

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

[src]

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

[src]

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

[src]

The inverse of ApproxEq::relative_eq.

[src]

The inverse of ApproxEq::ulps_eq.

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

[src]

Formats the value using the given formatter. Read more

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

[src]

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

[src]

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

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

[src]

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

[src]

Returns true if self is equal to the additive identity.

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

[src]

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

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

The returned type after indexing.

Important traits for &'a mut W
[src]

Performs the indexing (container[index]) operation.

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

Important traits for &'a mut W
[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

[src]

Performs the *= operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

The resulting type after applying the / operator.

[src]

Performs the / operation.

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

[src]

Performs the /= operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the * operator.

[src]

Performs the * operation.

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

The resulting type after applying the - operator.

[src]

Performs the unary - operation.

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

The resulting type after applying the - operator.

[src]

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]

[src]

Performs the += operation.

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

[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]

[src]

Performs the -= operation.

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

[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]

[src]

Performs the *= operation.

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

[src]

Performs the *= operation.

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

[src]

The identity element.

[src]

Specific identity.

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

[src]

The identity element.

[src]

Specific identity.

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

[src]

Performs an operation.

[src]

Performs specific operation.

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

[src]

Performs an operation.

[src]

Performs specific operation.

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

[src]

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

[src]

In-place inversin of self.

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

[src]

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

[src]

Returns true if associativity holds for the given arguments.

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

[src]

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

[src]

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]

[src]

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

[src]

Returns true if associativity holds for the given arguments.

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

[src]

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

[src]

Returns true if latin squareness holds for the given arguments.

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

[src]

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

[src]

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]

[src]

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

[src]

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

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

The underlying scalar field.

[src]

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]

[src]

The vector space dimension.

[src]

The i-the canonical basis element.

[src]

The dot product between two vectors.

Important traits for &'a mut W
[src]

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

Important traits for &'a mut W
[src]

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

[src]

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]

[src]

The squared norm of this vector.

[src]

The norm of this vector.

[src]

Returns a normalized version of this vector.

[src]

Normalizes this vector in-place and returns its norm.

[src]

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

[src]

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]

[src]

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

[src]

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

[src]

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

[src]

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.

[src]

Dereferences the value.

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

[src]

Mutably dereferences the value.

Auto Trait Implementations

impl<N> Send for Quaternion<N>

impl<N> Sync for Quaternion<N>