Module Gg.Quat
type t= quatThe type for quaternions.
Constructors, accessors and constants
val v : float -> float -> float -> float -> quatv x y z wis the quaternionxi+yj +zk +w.
val zero : quatzerois the zero quaternion.
val id : quatidis the identity quaternion1.
Functions
val conj : quat -> quatconj qis the quaternion conjugateq*.
val slerp : quat -> quat -> float -> quatslerp q r tis the spherical linear interpolation betweenqandratt. Non commutative, torque minimal and constant velocity.
3D space transformations
val of_m4 : m4 -> quatof_m4 mis the unit quaternion for the rotation in the 3x3 top left matrix inm.
val rot3_map : v3 -> v3 -> quatUnit quaternion for the rotation, see
M3.rot3_map.
val rot3_axis : v3 -> float -> quatUnit quaternion for the rotation, see
M3.rot3_axis.
val rot3_zyx : v3 -> quatUnit quaternion for the rotation, see
M3.rot3_zyx.
val to_rot3_axis : quat -> v3 * floatto_rot3_axis qis the rotation axis and angle in radians of the unit quaternionq.
val to_rot3_zyx : quat -> v3to_rot_zyx qis the x, y, z axis angles in radians of the unit quaternionq.