M@ Dunlap created MATH-847:
------------------------------

             Summary: Using Rotation to convert Euler angles to Quaternions 
produces wrong results
                 Key: MATH-847
                 URL: https://issues.apache.org/jira/browse/MATH-847
             Project: Commons Math
          Issue Type: Bug
    Affects Versions: 3.0
         Environment: 1.6
            Reporter: M@ Dunlap


import org.apache.commons.math3.geometry.euclidean.threed.Rotation;
import org.apache.commons.math3.geometry.euclidean.threed.RotationOrder;

public class temp {
  public static void main(String args[]) {
    Rotation r = new Rotation(RotationOrder.XYZ, -Math.PI / 2d, 0, 0);
    System.out.println("(" + r.getQ0() + " " + r.getQ1() + " " + r.getQ2() + " 
" + r.getQ3() + ")");
  }
}

Prints (0.707 0.707 0.0 0.0) (in-sig-figs elided), but when I type the same 
thing into Wolfram Alpha I get (.707 -.707 0 0) (note the negative)  see: 
http://www.wolframalpha.com/input/?i=euler+angles&a=*C.euler+angles-_*Formula.dflt-&a=*FP.EulerRotation.EAS-_e123&f3=-pi%2F2+rad&f=EulerRotation.th1_-pi%2F2+rad&f4=0&f=EulerRotation.th2_0&f5=0&f=EulerRotation.th3_0

One of the guys in the lab suggested that if Rotation is assuming the Euler 
angle is in a left-handed coordinate space this is an expected result, but if 
that's the case the question is, why is the less popular coordinate system the 
only option?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to