isQuaternion()
Returns 1 if x is a quaternion.
This implementation of quaternions is not complete; only the features needed for representing rotation matrices by quaternions are implemented.
Constructor:
Quaternion(q0, q1, q2, q3) (from four real components)
Quaternion(q) (from a sequence containing the four components)
Quaternions support addition, subtraction, and multiplication, as well as multiplication and division by scalars. Division by quaternions is not provided, because quaternion multiplication is not associative. Use multiplication by the inverse instead.
The four components can be extracted by indexing.
Methods:Returns the norm.
Returns the quaternion scaled to norm 1.
Returns the inverse.
Returns a 4x4 matrix representation.
Returns the corresponding rotation matrix (the quaternion must be normalized).