# How can I find equivalent Euler angles?

I have a rotation over time represented as a series of Euler angles (heading, pitch and bank). I'd like to represent the individual rotation curves as continuously as possible. An anyone help me with how I would calculate the equivalent Euler angle representations for a single rotation, from where I could derive the "closest" equivalent to the prior rotation in time?

Thanks!

I realize that half the problem may be my inability to properly express the problem in the first place. Perhaps a concrete example might make it a bit clearer. I have two rotations around a common xyz axis expressed in degrees as Euler angles: (-224.782, 265, 214.25) and (-44.782, -85, 34.215). These produce an equivalent orientation. Supposing that I started with the latter, which is "normalized" to the range to -180 <= x <= 180, -90 <= y <= 90, -180 <= z <= 180, how would I arrive at the former? Apologies for the layman explanation.

-
–  Shiyu Aug 4 '11 at 6:41
That's just not helpful at all. I'm quite capable of googling - I'm just not quite smart enough to understand the question that I've posed from the material that I've read. Hence posting the question on a forum frequented by people much smarter than myself in the hope that they could provide some conversation that could help me in my understanding. –  Phil Boltt Aug 4 '11 at 8:15

Are you constrained to using Euler angles? If you can decide freely what representation to use, quaternions would be preferable. In that representation, it's very easy to find which of two quaternions representing a rotation (which differ only by a sign) is closer to a given one.

With Euler angles, if you want the representation to be continuous, you can let the angles range over $\mathbb R$ instead of restricting them to a single (half-)period. However, choosing the nearest of the equivalent representations will then be more complicated than with quaternions. Quite generally, a lot of things that are nasty, complicated and potentially numerically unstable with Euler angles become nicer and easier when you use quaternions.

[Edit in response to the comments:]

There are three equivalences, one obvious, another less obvious and a third only applicable in certain circumstances.

The obvious one is that you can always add multiples of $2\pi$ to any of the angles; if you let them range over $\mathbb R$, which you must if you want to get continuous curves, this corresponds to using $\mathbb R^3$ as the parameter space instead of the quotient $(\mathbb R/2\pi\mathbb Z)^3$. This equivalence is easy to handle since you can change the three angles independently, that is, if you change one of them by a multiple of $2\pi$, you directly get the same rotation without changing the other two parameters.

What's less obvious is that (referring to this image) the transformation $(\alpha,\beta,\gamma)\rightarrow(\alpha+\pi,-\beta,\gamma+\pi)$ leads to the same rotation. (This is why, in order to get unique angles, $\beta$ has to be limited to an interval of length $\pi$, not $2\pi$.)

A third equivalence comes into play only if $\beta\equiv0\pmod\pi$, since in this case $\alpha$ and $\gamma$ apply to the same axis and changing $\alpha+\gamma$ doesn't change the rotation. If your rotations are arbitrary and have no reason to have $\beta\equiv0$, you won't need to consider this case, though it may cause numerical problems if you get close to $\beta\equiv0$ (which is one good reason to use quaternions instead of Euler angles).

These three transformations generate all values of the Euler angles that are equivalent to each other. Remember that you also have to consider combinations of them, e.g. you can add multiples of $2\pi$ in $(\alpha+\pi,-\beta,\gamma+\pi)$ to get further equivalent angles.

-
Unfortunately I am constrained to using Euler angles in this particular situation. Underlying calculations are performed using quaternions, but the results are presented as Euler angles and this is where I'm encountering this problem. I need to present a continuous curve per Euler axis over time. I may just be missing some obvious link in my understanding of the subject. I know that I can add 2*PI per axis while the rotation remains "equivalent". but how does one conceive of the equivalents of an arbitrary rotation around x,y,z? Struggling mathematician? Yes. –  Phil Boltt Aug 4 '11 at 11:01
@Phil: I don't understand what you mean by "how does one conceive of the equivalents of an arbitrary rotation around x,y,z". They're equivalent angles for the same rotation -- in what sense do you want to "conceive" of them? Also, is your question about finding the equivalents, or about choosing among them? The latter has nothing to do with rotations and is just a question of defining a metric on the parameter space and finding the one of the equivalents that is closest to the previous point in parameter space. –  joriki Aug 4 '11 at 11:04
Apologies for being vague. The question is specifically about finding the equivalents. For example, suppose I have angles x,y and z, all of whom are in the range -2*PI > 2*PI, how do I find all combinations of x,y,z that produce an equivalent rotation either within that same range, or as an element of the set of real numbers? –  Phil Boltt Aug 4 '11 at 11:18
@Phil: Apologies are in order from my side; I realize now that my question whether you want to find equivalents or choose among them was already answered in your original post. –  joriki Aug 5 '11 at 2:03
Many thanks for the explanation, Joriki. The "less obvious" case is what I've been struggling with. Would it also hold true that $(\alpha,\beta,\gamma)\rightarrow(-\alpha,\beta+\pi,-\gamma)$ also leads to the same rotation? –  Phil Boltt Aug 5 '11 at 2:08