Quaternions and Rotations
In "Best solution to an overdetermined system," TMJ 6(3): 20, a least squares method was used to compute numerically the quaternion that corresponds to the rotation matrix
through the equivalence of to the general (quaternion) rotation matrix:
P. Chesson (firstname.lastname@example.org) pointed out the quaternions can be determined directly. Since is a rotation matrix, its determinant
must be 1. This condition and the equation determines a Grbner basis for the quaternion variables.
We can now use to simplify any combination of quaternions. For the monomials
the reduced polynomials are
the (arbitrary) quaternion is
For example, the numerical rotation matrix
corresponds to the quaternion
The positive square root for ensures represents a proper rotation. The equivalence of and is easily tested.