Struct static_math::quaternion::Quaternion[][src]

#[repr(C)]
pub struct Quaternion<T> { /* fields omitted */ }
Expand description

Quaternion type

Implementations

Construct a new Quaternion from a number(real part) and a vector(imag part)

Construct a new Quaternion from raw four numbers

dot product

get the real part

get the imaginary part

construct a unit Quaternion

construct a zero Quaternion

construct a pure “real” Quaternion

construct a pure “imaginary” Quaternion

calculate the abs2 of the Quaternion

Construct a new Quternion from a V4

convert the Quaternion to a rotation matrix

convert a rotation matrix M33 to a Quaternion

the euclidean norm of the Quaternion

normalize the Quaternion only if necessary

get the norm of the “imaginary” part

generate a Quaternion that represents a rotation of a angle theta around the axis(normalized) v

generate a Quaternion that represents a rotation of a angle theta around the axis(normalized) v, the angle theta is encoded in the norm of the vector v

create a quaternion that represents the rotation from a Euler angles with the roll-pitch-yay convention

get the angle of representation from this Quaternion

get the axis of rotation from which this Quaternion represent

combine the two previous methods: get_axis and get_angle

normalize the Quaternion

get the argument of the Quaternion

exponential function apply to the current Quaternion

natural logaritmic function apply to the current Quaternion

sqrt function apply to the current Quaternion

power the current Quaternion to the rhs argument

Spherical Linear Interpolation between two Quaternions this implementation follow this implementations:

https://www.mrpt.org/tutorials/programming/maths-and-geometry/slerp-interpolation/

Function arguments:

a: Quaternion(normalized)

b: Quaternion(normalized)

t: Float in the closed interval [0.0, 1.0]

Calculate the instantaneous Quaternion derivative representing a Quaternion rotating at rate given by a vector rate

Function arguments:

rate: V3

Calculate the inverse of the Quaternion

sin function apply to the current Quaternion

cos function apply to the current Quaternion

get the euler angles from the Quaternion

Trait Implementations

The resulting type after applying the + operator.

Performs the + operation. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

The resulting type after applying the / operator.

Performs the / operation. Read more

Performs the conversion.

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the * operator.

Performs the * operation. Read more

The resulting type after applying the - operator.

Performs the unary - operation. Read more

Create an identity Quaternion

Sets self to the multiplicative identity element of Self, 1.

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

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

This method tests for !=.

The resulting type after applying the - operator.

Performs the - operation. Read more

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

Returns true if self is equal to the additive identity.

Sets self to the additive identity element of Self, 0.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.