Struct euclid::TypedRotation3D [] [src]

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

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

[src]

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

impl<T, Src, Dst> TypedRotation3D<T, Src, Dst> where
    T: Copy + Clone + Add<T, Output = T> + Sub<T, Output = T> + Mul<T, Output = T> + Div<T, Output = T> + Neg<Output = T> + ApproxEq<T> + PartialOrd + Float + One + Zero
[src]

[src]

Creates the identity rotation.

[src]

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.

[src]

Creates a rotation around a given axis.

[src]

Creates a rotation around the x axis.

[src]

Creates a rotation around the y axis.

[src]

Creates a rotation around the z axis.

[src]

Creates a rotation from euler angles.

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

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

[src]

Returns the inverse of this rotation.

[src]

Computes the norm of this quaternion

[src]

[src]

Returns a unit quaternion from this one.

[src]

[src]

Spherical linear interpolation between this rotation and another rotation.

t is expected to be between zero and one.

[src]

Basic Linear interpolation between this rotation and another rotation.

t is expected to be between zero and one.

[src]

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.

[src]

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.

[src]

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.

[src]

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.

[src]

Returns the matrix representation of this rotation.

[src]

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

[src]

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

Trait Implementations

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

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

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

[src]

Measure the size of any heap-allocated structures that hang off this value, but not the space taken up by the value itself (i.e. what size_of:: measures, more or less); that space is handled by the implementation of HeapSizeOf for Box below. Read more

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

[src]

Deserialize this value from the given Serde deserializer. Read more

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

[src]

Serialize this value into the given Serde serializer. Read more

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

impl<T, Src, Dst> PartialEq for TypedRotation3D<T, Src, Dst> where
    T: PartialEq
[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<T, Src, Dst> Hash for TypedRotation3D<T, Src, Dst> where
    T: Hash
[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<T: Debug, Src, Dst> Debug for TypedRotation3D<T, Src, Dst>
[src]

[src]

Formats the value using the given formatter.

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

[src]

Formats the value using the given formatter. Read more

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

[src]

[src]

[src]