Module Gg.Quat
type t
= quat
The type for quaternions.
Constructors, accessors and constants
val v : float -> float -> float -> float -> quat
v x y z w
is the quaternionx
i+y
j +z
k +w
.
val zero : quat
zero
is the zero quaternion.
val id : quat
id
is the identity quaternion1
.
Functions
val conj : quat -> quat
conj q
is the quaternion conjugateq*
.
val slerp : quat -> quat -> float -> quat
slerp q r t
is the spherical linear interpolation betweenq
andr
att
. Non commutative, torque minimal and constant velocity.
3D space transformations
val of_m4 : m4 -> quat
of_m4 m
is the unit quaternion for the rotation in the 3x3 top left matrix inm
.
val rot3_map : v3 -> v3 -> quat
Unit quaternion for the rotation, see
M3.rot3_map
.
val rot3_axis : v3 -> float -> quat
Unit quaternion for the rotation, see
M3.rot3_axis
.
val rot3_zyx : v3 -> quat
Unit quaternion for the rotation, see
M3.rot3_zyx
.
val to_rot3_axis : quat -> v3 * float
to_rot3_axis q
is the rotation axis and angle in radians of the unit quaternionq
.
val to_rot3_zyx : quat -> v3
to_rot_zyx q
is the x, y, z axis angles in radians of the unit quaternionq
.