tomservo2007) - 2007-06-28 07:57
I copied and pasted the code on the page:
to convert euler angles to axis-angle. I edited the code to compile on my laptop
However, once I started using it, I noticed it did not give the same answers as the java applet calculator for euler-to-axis-angle.
Specifically, there are minus signs on some of the axis coordinates and sometimes the angle is about twice what it should be. Is there a problem with that code that anybody else has found?
martinbaker) - 2007-06-28 10:12
for letting me know about this, If there is a discrepancy between the
java applet calculator and the code on the euler-to-axis-angle page, my
number one suspect would be the applet calculator. I think this is used
less than the code on the main page and therefore less well tested.
Since the applet calculator works in a different way it could be
I'll have a look at it.
martinbaker) - 2007-07-03 07:09By: Martin Baker (
I found a bug in the applet which I think would have caused the discrepancy that you saw.
I've uploaded a new version and tested it as much as I can but I would appreciate any feedback about whether this fixes the problem.
nhughes) - 2007-07-03 20:45By: nhughes (
I fail to see why there is extended discussion on converting a set of Euler angles to an axis/angle representation. The conversion is trivial. The conversion process is as follows:
1) form three quaternions, one for each of the three Euler angles, being cognizant of the rotations and their order. For example, if the rotation sequence is 3-1-3, the three quaternions would be
Q1 = 0 0 sin(ang1/2) cos(ang1/2)
Q2 = sin(ang2/2) 0 0 cos(ang2/2)
Q3 = 0 0 sin(ang3/2) cos(ang3/2)
and so on for any of the twelve Euler rotation sequences.
2) perform the quaternion multiplication
Qt = Q1 * Q2 * Q3
3) the axis is the three vector elements, normalized (the first three elements, if you're using the scalar last convention, the second through fourth elements, if you're using the scalar first convention)
4) the angle is the inverse cosine of the scalar component (the component not used in step three).
Quaternion mathematics is not difficult!
In the next few months, I hope to complete a paper on my process for converting a quaternion to Euler angles for any rotation sequence (finding the time is the problem; I have a number of higher priority tasks ahead of this one). After I've published it, I will share it with you and any other interested parties.