Registered Member
|
I have a quaternion which, when converted to AxisAngle, yields angle which is (almost) 2*pi. I am a bit surprised, since most the time quaternions did just the right thing in representing the rotation in a very intuitive way - e.g. nearly +2*pi rotation would be represented as a very small positive rotation around the inverse axis, when converted to angle-axis (IIRC - I actually rarely have to do that conversion). What's the problem? Should I always say something like
The documentation does not specify range for angle; the source says
where std::acos (according to man acos) should give the result in range 0...pi, so the 0...2*pi range for angle is technically correct (but still surprising). This is an example with numbers:
which gives me
Cheers, Vaclav |
Moderator
|
I guess that's just a matter of taste. Now it's true that we can see this conversion as an atan2 that by convention returns values in [-pi,pi] range.
|
Registered Member
|
From my POV the most convenient would be to have the angle in the [0..pi] range, and inverse the axis if is the angle is <0 or >pi, to force the angle go back to [0..pi].
I agree that it is a matter of taste but I also plea for documenting the behavior, whichever it is. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]