Functions

from_axis_angle(theta, x, y, z) From Axis-Angle
inverse(q) Inversion
mul(q1, q2) Multiplication
normalize(q) Normalization
slerp(q1, q2, t) Spherical Linear Interpolation
to_axis_angle(q) To Axis-Angle
to_vector_x(q) To x-vector
to_vector_y(q) To y-vector
to_vector_z(q) To z-vector

Functions

from_axis_angle(theta, x, y, z)

Derives a quaternion from axis-angle format

Parameters:

theta Angle of rotation
x x-component of axis
y y-component of axis
z z-component of axis

Return:

  • Result quaternion
inverse(q)

Inverts a quaternion

Parameters:

q Quaternion

Return:

  • Result quaternion
mul(q1, q2)

Multiplies 2 quaternions

Parameters:

q1 First quaternion
q2 Second quaternion

Return:

  • result quaternion
normalize(q)

Normalizes a quaternion

Parameters:

q Quaternion

Return:

  • Result quaternion
slerp(q1, q2, t)

Executes spherical linear interpolation on 2 quaternions by the quaternion

Parameters:

q1 First quaternion (t=0)
q2 Second quaternion (t=1)
t Interpolation factor [0, 1]

Return:

  • Interpolated quaternion
to_axis_angle(q)

Derives the axis-angle format from a quaternion

Parameters:

q Quaternion

Return:

  • theta Angle of rotation
  • x-component of axis
  • y-component of axis
  • z-component of axis
to_vector_x(q)

Derives the x-axis of the orientation described by the quaternion

Parameters:

q Quaternion

Return:

  • x-axis vector
to_vector_y(q)

Derives the y-axis of the orientation described by the quaternion

Parameters:

q Quaternion

Return:

  • y-axis vector
to_vector_z(q)

Derives the z-axis of the orientation described by the quaternion

Parameters:

q Quaternion

Return:

  • z-axis vector