Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • I'm at work at the moment, I'll try this later and if it works I'll be somewhat chuffed :) (meant to put that on a separate line in the previous comment but apparently 'enter' means 'submit' in this particular text box) Commented Dec 3, 2010 at 10:57
  • there is a small problem, the returned value is always positive. which means that if I have a rotation of -PI/4 (or 7*PI/4) I get PI/4 as a result. Am I missing something here? Commented Jul 13, 2012 at 11:48
  • 1
    @João, you are not missing anything but maybe misunderstand slightly how this works :) The core of this method is the acos of the dot product of the resulting vectors - to put it another way - this method does not operate 'directly' on the quaternion but rather 'observes the results' of the application of that quaternion. Therefore, the angle returned will always be the smallest between the two vectors, and will be limited to 0-360 deg. You can recover whether the angle of transformation was negative or positive however using the cross product. Good luck! Commented Jul 13, 2012 at 17:20
  • @sebf Could you elaborate? Which vectors do you need to apply cross product to in order to find out? Commented Feb 8, 2018 at 14:03
  • ah, found it. You have to do the cross product between orthonormal1 and flattened Commented Feb 8, 2018 at 14:18