# (Graphics Gems IV, Shoemake) From matrix to euler angles explanation

I am trying to understand matrix to Euler angles conversion. So I read Graphics Gems IV, page 222 from Ken Shoemake. It states:

"Suppose we have code to convert a rotation matrix to XEDS angles, $R = R_z(c)R_y(b)R_x(a)$. If we are asked to extract XEDR, $R = R_z(a)R_y(b)R_x(c)$, we use our code as is, and swap $a$ and $c$ afterwards." Restated (am I wrong??), it means that a $XYZ$ rotation of $(a, b, c)$ around static axes, is equivalent to a $XYZ$ rotation of $(c, b, a)$ around moving axes. This is exactly what they are doing in the source code.

In wikipedia, they state instead: "For either Euler or Tait-Bryan angles, it is very simple to convert from an intrinsic (rotating axes) to an extrinsic (static axes) convention, and vice-versa: just swap the order of the operations. An $(a, b, c)$ rotation using $X-Y-Z$ intrinsic convention is equivalent to a $(c, b, a)$ rotation using $Z-Y-X$ extrinsic convention; this is true for all Euler or Tait-Bryan axis combinations."

Restated (am I wrong 2 ? ), it means that a $XYZ$ rotation of $(a, b, c)$ around static axes, is equivalent to a $ZYX$ rotation of $(c, b, a)$ around moving axes which I can understand if I derive the sequence of rotation in static frames starting from the sequence of rotation in moving frames.

If I take a simple example,with no rotation around $Y$nor $Z, R = Rx(a)$ in static frames, Shoemake states that $R = R_z(a)$ in moving frames while wikipedia states that $R = Rx(a)$ in moving frames.

Moreover, taking it source code, and converting the same Euler angles with one rotation only and different rotation orders results in different quaternions. Intuitively, I believe that if we are rotating around one axis only, then order does not matter and it should always return the same quaternion.

PROBLEM:

Everybody is using Shoemake algo for a long time so it HAS to be right and I HAVE to be wrong. Someone could please help to see what I am doing wrong please?

Best regards.

-
What are XEDS angles? –  Rudy the Reindeer Jan 16 '12 at 13:25
@Matt: please see Graphics Gems IV, page 222 for an explanation. it is complicated enough that it would be useless for me to reproduce the text here. But I believe that my mistake is in a misunderstanding of the initial conventions... –  Korchkidu Jan 16 '12 at 14:11

-