Struct nalgebra::Quaternion [] [src]

pub struct Quaternion<N> {
    pub w: N,
    pub i: N,
    pub j: N,
    pub k: N,
}

A quaternion. See the UnitQuaternion type alias for a quaternion that can be used as a rotation.

Fields

The scalar component of the quaternion.

The first vector component of the quaternion.

The second vector component of the quaternion.

The third vector component of the quaternion.

Methods

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

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

The scalar part w of this quaternion.

impl<N: BaseNum + Neg<Output=N>> Quaternion<N>
[src]

Compute the conjugate of this quaternion.

Replaces this quaternion by its conjugate.

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

Creates a new quaternion from its scalar and vector parts.

Creates a new quaternion from its polar decomposition.

Note that axis is assumed to be a unit vector.

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 the y axis.

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

Compute the exponential of a quaternion.

Compute the natural logarithm of a quaternion.

Raise the quaternion to a given floating power.

impl<N: Zero + One> Quaternion<N>
[src]

Create the element of the canonical basis having this component set to one and all the others set to zero.

Create the element of the canonical basis having this component set to one and all the others set to zero.

Create the element of the canonical basis having this component set to one and all the others set to zero.

Create the element of the canonical basis having this component set to one and all the others set to zero.

impl<N> Quaternion<N>
[src]

Creation from component values.

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

Unsafe read access to a vector element by index.

Unsafe write access to a vector element by index.

impl<N> Quaternion<N>
[src]

The dimension of this entity.

Trait Implementations

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

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

Formats the value using the given formatter.

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

Feeds this value into the state given, updating the hasher as necessary.

Feeds a slice of this type into the state provided.

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<N: Decodable> Decodable for Quaternion<N>
[src]

impl<N: Encodable> Encodable for Quaternion<N>
[src]

impl<N: PartialEq> 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: Eq> Eq for Quaternion<N>
[src]

impl<N: BaseFloat> Inverse for Quaternion<N>
[src]

Returns the inverse of m.

In-place version of inverse.

impl<N: BaseFloat> Norm for Quaternion<N>
[src]

The scalar type for the norm (i.e. the undelying field).

Computes the squared norm of self. Read more

Gets the normalized version of a copy of v. Read more

Normalizes self. Read more

Gets the normalized version of a copy of v or None if the vector has a norm smaller or equal to min_norm. In particular, .try_normalize(0.0) returns None if the norm is exactly zero. Read more

Normalized v or does nothing if the vector has a norm smaller or equal to min_norm. Read more

Computes the norm of self.

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

The resulting type after applying the * operator

The method for the * operator

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

The method for the *= operator

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

The resulting type after applying the / operator

The method for the / operator

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

The method for the /= operator

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

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

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

Formats the value using the given formatter.

impl<N: Zero> 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: Add<N, Output=N>> Add<Quaternion<N>> for Quaternion<N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<N: AddAssign<N>> AddAssign<Quaternion<N>> for Quaternion<N>
[src]

The method for the += operator

impl<'a, 'b, N> Add<&'a Quaternion<N>> for &'b Quaternion<N> where &'b N: Add<&'a N, Output=N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, N> Add<&'a Quaternion<N>> for Quaternion<N> where N: Add<&'a N, Output=N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, N> Add<Quaternion<N>> for &'a Quaternion<N> where &'a N: Add<N, Output=N>
[src]

The resulting type after applying the + operator

The method for the + operator

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

The resulting type after applying the - operator

The method for the - operator

impl<N: SubAssign<N>> SubAssign<Quaternion<N>> for Quaternion<N>
[src]

The method for the -= operator

impl<'a, 'b, N> Sub<&'a Quaternion<N>> for &'b Quaternion<N> where &'b N: Sub<&'a N, Output=N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, N> Sub<&'a Quaternion<N>> for Quaternion<N> where N: Sub<&'a N, Output=N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, N> Sub<Quaternion<N>> for &'a Quaternion<N> where &'a N: Sub<N, Output=N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<N> FromIterator<N> for Quaternion<N>
[src]

Creates a value from an iterator. Read more

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

The resulting type after applying the - operator

The method for the unary - operator

impl<'a, N> Neg for &'a Quaternion<N> where &'a N: Neg<Output=N>
[src]

The resulting type after applying the - operator

The method for the unary - operator

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

Returns a value with filled by val.

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

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

impl<N: Copy + AddAssign<N>> AddAssign<N> for Quaternion<N>
[src]

The method for the += operator

impl<N: Copy + Add<N, Output=N>> Add<N> for Quaternion<N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, 'b, N> Add<&'a N> for &'b Quaternion<N> where &'b N: Add<&'a N, Output=N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, N> Add<N> for &'a Quaternion<N> where &'a N: Add<&'b N, Output=N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<'a, N> Add<&'a N> for Quaternion<N> where N: Add<&'a N, Output=N>
[src]

The resulting type after applying the + operator

The method for the + operator

impl<N: Copy + SubAssign<N>> SubAssign<N> for Quaternion<N>
[src]

The method for the -= operator

impl<N: Copy + Sub<N, Output=N>> Sub<N> for Quaternion<N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, 'b, N> Sub<&'a N> for &'b Quaternion<N> where &'b N: Sub<&'a N, Output=N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, N> Sub<N> for &'a Quaternion<N> where &'a N: Sub<&'b N, Output=N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<'a, N> Sub<&'a N> for Quaternion<N> where N: Sub<&'a N, Output=N>
[src]

The resulting type after applying the - operator

The method for the - operator

impl<N: Copy + MulAssign<N>> MulAssign<N> for Quaternion<N>
[src]

The method for the *= operator

impl<N: Copy + Mul<N, Output=N>> Mul<N> for Quaternion<N>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'a, 'b, N> Mul<&'a N> for &'b Quaternion<N> where &'b N: Mul<&'a N, Output=N>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'a, N> Mul<N> for &'a Quaternion<N> where &'a N: Mul<&'b N, Output=N>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<'a, N> Mul<&'a N> for Quaternion<N> where N: Mul<&'a N, Output=N>
[src]

The resulting type after applying the * operator

The method for the * operator

impl<N: Copy + DivAssign<N>> DivAssign<N> for Quaternion<N>
[src]

The method for the /= operator

impl<N: Copy + Div<N, Output=N>> Div<N> for Quaternion<N>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, 'b, N> Div<&'a N> for &'b Quaternion<N> where &'b N: Div<&'a N, Output=N>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, N> Div<N> for &'a Quaternion<N> where &'a N: Div<&'b N, Output=N>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<'a, N> Div<&'a N> for Quaternion<N> where N: Div<&'a N, Output=N>
[src]

The resulting type after applying the / operator

The method for the / operator

impl<N: BaseFloat> PartialOrder for Quaternion<N>
[src]

Returns the infimum of this value and another

Returns the supremum of this value and another

Compare self and other using a partial ordering relation.

Returns true iff self and other are comparable and self < other.

Returns true iff self and other are comparable and self <= other.

Returns true iff self and other are comparable and self > other.

Returns true iff self and other are comparable and self >= other.

Return the minimum of self and other if they are comparable.

Return the maximum of self and other if they are comparable.

Clamp value between min and max. Returns None if value is not comparable to min or max. Read more

impl<Nin: Copy, Nout: Copy + Cast<Nin>> Cast<Quaternion<Nin>> for Quaternion<Nout>
[src]

Converts an element of type T to an element of type Self.

impl<N: ApproxEq<N>> ApproxEq<N> for Quaternion<N>
[src]

Default epsilon for approximation.

Default ULPs for approximation.

Tests approximate equality.

Tests approximate equality using a custom epsilon.

Tests approximate equality using units in the last place (ULPs)

impl<N: Axpy<N>> Axpy<N> for Quaternion<N>
[src]

Adds $$a * x$$ to self.

impl<N: Bounded> Bounded for Quaternion<N>
[src]

The maximum value.

The minimum value.

impl<N> AsRef<[N; 4]> for Quaternion<N>
[src]

Performs the conversion.

impl<N> AsMut<[N; 4]> for Quaternion<N>
[src]

Performs the conversion.

impl<'a, N> From<&'a [N; 4]> for &'a Quaternion<N>
[src]

Performs the conversion.

impl<'a, N> From<&'a mut [N; 4]> for &'a mut Quaternion<N>
[src]

Performs the conversion.

impl<'a, N: Clone> From<&'a [N; 4]> for Quaternion<N>
[src]

Performs the conversion.

impl<N> Dimension for Quaternion<N>
[src]

The dimension of the object.

impl<N> Shape<usize> for Quaternion<N>
[src]

Returns the shape of an indexable object.

impl<N: Copy> Indexable<usize, N> for Quaternion<N>
[src]

Swaps the i-th element of self with its j-th element.

Reads the i-th element of self. Read more

Writes to the i-th element of self. Read more

impl<N, T> Index<T> for Quaternion<N> where [N]: Index<T>
[src]

The returned type after indexing

The method for the indexing (Foo[Bar]) operation

impl<N, T> IndexMut<T> for Quaternion<N> where [N]: IndexMut<T>
[src]

The method for the indexing (Foo[Bar]) operation

impl<N> Iterable<N> for Quaternion<N>
[src]

Gets a vector-like read-only iterator.

impl<N> IterableMut<N> for Quaternion<N>
[src]

Gets a vector-like read-write iterator.