Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-847

Using Rotation to convert Euler angles to Quaternions produces wrong results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 3.0
    • 3.1
    • None
    • 1.6

    Description

      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?

      Attachments

        Activity

          People

            Unassigned Unassigned
            dunmatt M@ Dunlap
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: