[][src]Struct euclid::TypedRotation3D

#[repr(C)]
pub struct TypedRotation3D<T, Src, Dst> { pub i: T, pub j: T, pub k: T, pub r: T, // some fields omitted }

A transform that can represent rotations in 3d, represented as a quaternion.

Most methods expect the quaternion to be normalized. When in doubt, use unit_quaternion instead of quaternion to create a rotation as the former will ensure that its result is normalized.

Some people use the x, y, z, w (or w, x, y, z) notations. The equivalence is as follows: x -> i, y -> j, z -> k, w -> r. The memory layout of this type corresponds to the x, y, z, w notation

Fields

Methods

impl<T, Src, Dst> TypedRotation3D<T, Src, Dst>
[src]

Creates a rotation around from a quaternion representation.

The parameters are a, b, c and r compose the quaternion a*i + b*j + c*k + r where a, b and c describe the vector part and the last parameter r is the real part.

The resulting quaternion is not necessarily normalized. See unit_quaternion.

impl<T, Src, Dst> TypedRotation3D<T, Src, Dst> where
    T: Copy
[src]

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

impl<T, Src, Dst> TypedRotation3D<T, Src, Dst> where
    T: Float
[src]

Creates the identity rotation.

Creates a rotation around from a quaternion representation and normalizes it.

The parameters are a, b, c and r compose the quaternion a*i + b*j + c*k + r before normalization, where a, b and c describe the vector part and the last parameter r is the real part.

Creates a rotation around a given axis.

Creates a rotation around the x axis.

Creates a rotation around the y axis.

Creates a rotation around the z axis.

Creates a rotation from Euler angles.

The rotations are applied in roll then pitch then yaw order.

  • Roll (also called bank) is a rotation around the x axis.
  • Pitch (also called bearing) is a rotation around the y axis.
  • Yaw (also called heading) is a rotation around the z axis.

Returns the inverse of this rotation.

Computes the norm of this quaternion

Returns a unit quaternion from this one.

Spherical linear interpolation between this rotation and another rotation.

t is expected to be between zero and one.

Basic Linear interpolation between this rotation and another rotation.

t is expected to be between zero and one.

Returns the given 3d point transformed by this rotation.

The input point must be use the unit Src, and the returned point has the unit Dst.

Returns the given 2d point transformed by this rotation then projected on the xy plane.

The input point must be use the unit Src, and the returned point has the unit Dst.

Returns the given 3d vector transformed by this rotation then projected on the xy plane.

The input vector must be use the unit Src, and the returned point has the unit Dst.

Returns the given 2d vector transformed by this rotation then projected on the xy plane.

The input vector must be use the unit Src, and the returned point has the unit Dst.

Returns the matrix representation of this rotation.

Returns a rotation representing the other rotation followed by this rotation.

Returns a rotation representing this rotation followed by the other rotation.

Trait Implementations

impl<T, Src, Dst> ApproxEq<T> for TypedRotation3D<T, Src, Dst> where
    T: Copy + Neg<Output = T> + ApproxEq<T>, 
[src]

impl<T, Src, Dst> PartialEq<TypedRotation3D<T, Src, Dst>> for TypedRotation3D<T, Src, Dst> where
    T: PartialEq
[src]

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

This method tests for !=.

impl<T, Src, Dst> Eq for TypedRotation3D<T, Src, Dst> where
    T: Eq
[src]

impl<T: Display, Src, Dst> Display for TypedRotation3D<T, Src, Dst>
[src]

Formats the value using the given formatter. Read more

impl<T: Debug, Src, Dst> Debug for TypedRotation3D<T, Src, Dst>
[src]

Formats the value using the given formatter. Read more

impl<T, Src, Dst> Hash for TypedRotation3D<T, Src, Dst> where
    T: Hash
[src]

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

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

impl<T: Copy, Src, Dst> Copy for TypedRotation3D<T, Src, Dst>
[src]

impl<T: Clone, Src, Dst> Clone for TypedRotation3D<T, Src, Dst>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T, Src, Dst> Serialize for TypedRotation3D<T, Src, Dst> where
    T: Serialize
[src]

Serialize this value into the given Serde serializer. Read more

impl<'de, T, Src, Dst> Deserialize<'de> for TypedRotation3D<T, Src, Dst> where
    T: Deserialize<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations

impl<T, Src, Dst> Send for TypedRotation3D<T, Src, Dst> where
    Dst: Send,
    Src: Send,
    T: Send

impl<T, Src, Dst> Sync for TypedRotation3D<T, Src, Dst> where
    Dst: Sync,
    Src: Sync,
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

Converts the given value to a String. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]