I've been writing a small utility library for converting different 3D rotation representations. My sources are mainly Wikipedia, a couple text books, and Martin Baker's excellent site. I've been unit testing each of my conversions (using values verified with MATLAB), and the only ones that don't hold up are the Euler angles to axis-angle conversion and the inverse of that. Using Martin Baker's conventions of bank=Rx
, heading=Ry
, and attitude=Rz
, I'm unable to achieve the correct output.
I'm using his equations from here for axis-angle to Euler, and here for Euler to axis-angle, but they are not matching my sample cases. I'm thinking it may be confusion over ordering.
Given Rx
, Ry
, and Rz
representing rotation about the X, Y, and Z axes, respectively, and applied in XYZ
order (i.e. first rotate around X, then Y, then Z), what is the conversion from Euler angles to axis-angle, and vice versa?
NOTE: Ultimately I can always fall back to converting through another representation such as a quaternion, as those pairs of conversions work. However, I'd like to understand the direct conversion.
I am aware of this question that has been asked here previously, but the accepted solution is overly formal and I can't quite extract the simple conversion equations. The second answer converts through a rotation matrix, and, as I mentioned, I'd like to find a direct conversion.