Difference between quaternions and rotation matrices

2.6k Views Asked by At

This is a really simple question, I guess. Do quaternions cover the same set of rotations as rotation matrices? I assume the answer is yes, they both can represent SO(3), but I'm unsure about the sources which prove that.

Extending the question a bit further, where is the difference between quaternions and rotation matrices? It seems that the rotations are the same, there are inversion and multiplication operators for both. So what is the actual difference?

We are using quaternions and rotation matrices in a nonlinear optimization framework, where we estimate positions of a bunch of things in SE(3). Quaternions are appealing since there are only four coefficients to be estimated, and only three of those need to be actually stored (we have normalized quaternions). So far we have two versions of the code, using quaternions and using rotation matrices, and both of those versions give the same results (well, almost, thanks to the floating point precision). Is there a point where "quaternions will break"?

2

There are 2 best solutions below

2
On BEST ANSWER

The unit quaternions are isomorphic to the group $SU(2)$ of unitary matrices of determinant $1$. Geometrically, they form $S^3$, the $3$-sphere.

On the other hand, the group of rotations in $\Bbb{R}^3$ is $SO(3)$, consisting of orthogonal (orthonormal, really) matrices of determinant $1$. Geometrically, they form $\Bbb{R}P^3$, $3$-dimensional projective space.

The group $SU(2)$ forms a double cover of $SO(3)$, which means that there are exactly $2$ elements of $SU(2)$ (differing by a sign) that correspond to each element of $SO(3)$.

This has a geometric analogue, too. Pairs of antipodal points in $S^3$ are identified to form a single point in $\Bbb{R}P^3$.

You may enjoy the brief discussion here, and the more lengthy one here as well.

0
On

From a practical perspective, quaternions offer the benefit of smaller representation size, ease of concatenation, and ease of renormalization.

When you concatenate the rotations, you can check for yourself that calculating the product of quaternions is fewer operations than a full matrix multiplication. It's then trivial after concatenation to calculate the magnitude of the resulting quaternion and divide by that magnitude to keep things normalized.