5
$\begingroup$

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 \leq x \leq 180$, $-90\leq y\leq 90$, $-180 \leq z \leq 180$, how would I arrive at the former? Apologies for the layman explanation.

$\endgroup$
2
  • $\begingroup$ Try en.wikipedia.org/wiki/Euler_angles? $\endgroup$
    – Shiyu
    Aug 4, 2011 at 6:41
  • 9
    $\begingroup$ 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. $\endgroup$
    – Phil Boltt
    Aug 4, 2011 at 8:15

2 Answers 2

10
$\begingroup$

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,\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/2}$, 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.

$\endgroup$
11
  • $\begingroup$ 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. $\endgroup$
    – Phil Boltt
    Aug 4, 2011 at 11:01
  • 1
    $\begingroup$ @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. $\endgroup$
    – joriki
    Aug 4, 2011 at 11:04
  • $\begingroup$ 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? $\endgroup$
    – Phil Boltt
    Aug 4, 2011 at 11:18
  • $\begingroup$ @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. $\endgroup$
    – joriki
    Aug 5, 2011 at 2:03
  • 1
    $\begingroup$ I've been banging my head on the same problem Phil was for a while now (dealing with input data that compares against euler rotations, so quaternions just don't help) . Isn't it (α,β,γ)→(α+π,π−β,γ+π)? (0,0,0) and (180,0,180) point in opposite directions, (180,-180,180) is the same as (0,0,0). $\endgroup$ Jun 3, 2016 at 5:06
1
$\begingroup$

There are some errors in the third equivalence in the other answer (at time of writing) by @joriki. A revised version is below.

A third equivalence comes into play only if $\beta\equiv\pi/2\pmod{\pi}$, since in this case $\alpha$ and $\gamma$ apply to the same axis. In these cases, changing $\alpha$ and $\gamma$ in ways that don't change $\alpha+\gamma$ when they apply in the same direction (when they apply in opposite directions, $\alpha-\gamma$) thus will not change the rotation. If your rotations are arbitrary and have no reason to have $\beta\equiv\pi/2$, you won't need to consider this case, though it may cause numerical problems if you get close to $\beta\equiv\pi/2$ (which is one good reason to use quaternions instead of Euler angles).

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .