Quaternions.Qval create : float -> Owl.Mat.mat -> ([ `unit ], _) tcreate theta u creates a unit quaternion correponsing to a rotation of angle theta around axis u. Note that u is first normalised so only its direction matters.
val create_real : float -> (_, [ `real ]) tval create_imag : Owl.Mat.mat -> (_, [ `imaginary ]) tval unpack : (_, _) t -> float * Owl.Mat.matExtracts the real (scalar) and imaginary (vector) part of a quaternion
val unpack_flt : (_, _) t -> float * (float * float * float)val of_ypr : (float * float * float) -> ([ `unit ], _) tCreate a unit quaternion from the yaw, pitch, and roll angles.
val to_ypr : ([ `unit ], _) t -> float * float * floatExtract (yaw, pitch, roll) from a quaternion; these are the conventions used by J Wilson et al 2018, corresponding to the intrinsic Tait-Bryan angles following the (x'' - y' - z) convention -- cf wikipedia.
val to_vec : (_, _) t -> Owl.Mat.matPacks a quaternion as a 4D vector.
val of_vec : Owl.Mat.mat -> (_, _) tUnpacks a 4D vector into a quaternion.
Renormalises a quaternion (so it becomes a unit quaternion)
val sqr_norm : (_, _) t -> floatSquared norm of a quaternion
val to3D : ([ `unit ], _) t -> Owl.Mat.matplace a quaternion inside the 3D ball used to visualise them
val sample : unit -> ([ `unit ], _) tsample quaternions from a geodesic-uniform distribution on SO(3)