Quaternions



Some quick info on Quaternions.


 * 1) A Quaternion does not have a direction by itself, it is a rotation. It can be used to rotate any vector by the rotation it represents.
 * 2) A quaternion doesn't have a direction by itself. It is a rotation (reminds of a Transform)
 * 3) Rotation always requires unitized or "normalized" quaternions.
 * 4) Quaternions CAN be used for both Orientation and  Rotation.
 * 5) Quaternions can be combined into one - by Multiplication.
 * 6) If having one quaternion for Orientation (Qa) and another for Rotation (Qb) and you want to perform the Rotation on Qa then simply Multiply Qa * Qb.
 * 7) Some platforms or implementations of quaternions may have a Rotate function, but that would be the same as applying multiplication (Qresult = Qa * Qb).
 * 8) Quaternion multiplication/Rotation is not commutative (A * B is not the same as B * A).
 * 9) Inverting a quaternion is the same as  . Also look for a function Q.Inverse;
 * 10) Derive the Angle from a Quaternion like so:

Inverse
Example implementation of Inverse (conjugate):



Slerp
Slerp takes two orientations, not relative rotations. See ogre3d. Example implementation of Slerp (Spherical Linear Interpolation):



Example implementation of Slerp between two Planes:



Axis Angle
Example implementation of Axis Angle from the scalar "w":