# 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. Commented Apr 23, 2014 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$. Commented Apr 23, 2014 at 8:01

Less mathsie take on this, coming from a game dev here.

But typically when we work with quaternions to represent rotations/orientations, we like to keep them normalized to avoid dealing with these sorts of many-to-one mappings (among other interesting reasons).

... and even then there remains one case where two unit quaternions will still represent the same orientation, and that is when their axis and angle components are negatives of the other's.

But outside of that, yeah what the other guy said, any multiple of a real number is liable. Normalizing cuts out that infinite crud, but you still gotta sanity check that you don't happen to be staring at a negative doppleganger of the orientation you actually expected (which would still be correct!)

Edit: Realized that this is one of those uncommon cases where the distinction between "rotation" and "orientation" is important.

• Aside on "rotation" vs. "orientation": I like to think of "orientations" as instantaneous states (i.e. keyframes in an animation) and "rotations" as transformations on those instants (i.e. the transformation required to make keyframe A into keyframe B). Commented Jul 16 at 11:37