# Can different quaternions represent the same orientation?

For a current project I'm working on I have to use quaternions to represent the orientation of an object. The piece of code I'm working on now integrates rotation rates to the quaternion representing the orientation. To test it I made a simulink model to simulate a rotating object and compare my result with the one from the simulation.

I noticed that if I compare the quaternion calculated by Simulink's "rotation angles to quaternion" block, it's not the same as the one I calculated, but if I convert both back to rotation angles they are the same.

This leads me to the conclusion that several quaternions can represent the same orientation. But since I'm new to quaternions I thought I might just ask to be sure.

• Do you get more than a sign difference in these results? The quaternion is like the square root of the rotation, with $q$ also $-q$ is a solution. Matrix-to-quaternion has to make a choice that stays always on the same half-sphere of unit quaternions, while continuation can wind its way to the other side. – Lutz Lehmann Apr 23 '14 at 8:05

If a quaternion is multiplied by any real number, it still represents the same rotation in $\mathbb{R}^3$. That's the only way two quaternions can represent the same rotation.
In more detail: $\mathbb{R}^3$ can be identified with the quaternions $E = \{ xi + yj + zk : x,y,z \in \mathbb{R}\}$ having zero real part, via the obvious map $(x,y,z) \mapsto xi + yj + zk$. Now if $q$ is any nonzero quaternion, then $q$ defines a map $\alpha_q : E \to E$ via $r \mapsto q^{-1}rq$. This is an isometry because the norm is multiplicative on quaternions. The map $\alpha_q$ sends 1 to 1, and $E$ is the orthogonal complement of 1, and hence $\alpha_q$ sends $E$ to $E$. Now one can check that $\alpha_q$ is the identity only when $q$ is real.
Edit (from LutzL's comment below): I am taking $\alpha \beta$ to mean do $\alpha$, then $\beta$ (i.e. maps are regarded as right operators). With the more standard order of left operators ($\alpha \beta$ means do $\beta$ then $\alpha$), you would need $r \mapsto qrq^{-1}$ instead.
• If you want that $α_p\circ α_q=α_{pq}$, then the inverse of $q$ should be in the last place, not the first $r \mapsto α_q(r)=qrq^{-1}$. -- Since the computation in the question almost surely gives unit quaternions, the only interesting multiple giving the same rotation is $-q$. – Lutz Lehmann Apr 23 '14 at 8:01