You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello there eRCaGuy, coming here from Wikipedia! Probably easier that way.
If you're interested, in this repo of mine you can find the first implementation I had done for the general conversion issue, meaning it works for all possible 12 axes sequences, symmetric or asymmetric (ZYZ, ZYX, etc) but also intrinsic or extrinsic: https://github.com/evbernardes/quaternion_to_euler
This algorithm was further improved and implemented on Scipy, replacing the original one.
To clarify a bit on the arctan2 or acos thing, there are two advantages: First, if you only use arctan2, it's possible to have equations that give you correct angles even when the quaternion is not properly normalized, meaning that, for some non-zero number A, both quat2euler(q) and quat2euler(A * q) will return the same angle. This is reason number 1 why this is safer numerically!
Reason number 2, that I discovered while doing the PR to Scipy, is that acos and asin implementations are also not super well behaved at the limits of their regions of definition, while arctan2 does not have that problem. This was hinted by the Scipy guy who helped me improve it before accepting it, and I was also possible to show that using arctan2 even let up to lower numerical errors! Which is one of the reasons my algorithm was accepted, since the former one also relied on a call to acos.
The text was updated successfully, but these errors were encountered:
Hello there eRCaGuy, coming here from Wikipedia! Probably easier that way.
If you're interested, in this repo of mine you can find the first implementation I had done for the general conversion issue, meaning it works for all possible 12 axes sequences, symmetric or asymmetric (ZYZ, ZYX, etc) but also intrinsic or extrinsic: https://github.com/evbernardes/quaternion_to_euler
This algorithm was further improved and implemented on Scipy, replacing the original one.
To clarify a bit on the
arctan2
oracos
thing, there are two advantages: First, if you only usearctan2
, it's possible to have equations that give you correct angles even when the quaternion is not properly normalized, meaning that, for some non-zero numberA
, bothquat2euler(q)
andquat2euler(A * q)
will return the same angle. This is reason number 1 why this is safer numerically!Reason number 2, that I discovered while doing the PR to Scipy, is that
acos
andasin
implementations are also not super well behaved at the limits of their regions of definition, whilearctan2
does not have that problem. This was hinted by the Scipy guy who helped me improve it before accepting it, and I was also possible to show that usingarctan2
even let up to lower numerical errors! Which is one of the reasons my algorithm was accepted, since the former one also relied on a call toacos
.The text was updated successfully, but these errors were encountered: