-
Notifications
You must be signed in to change notification settings - Fork 716
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quaternion Distance #336
Comments
You could use the dot product and convert it to an angle. You could also write a function that does this and create a PR. |
const invers = quat.invert(quat.create(), q1); |
@stefnotch happy to write a PR but this a beyond my math skills. How does jWA86's suggestion compare to the dot product idea? |
The quaternion dot product approach works as follows: https://www.3dgep.com/understanding-quaternions/#Quaternion_Dot_Product jWA86's approach isn't that complicated either. A quaternion is a rotation, or an axis-angle. And, the multiplication of quaternions represents composing the two rotations: perform one rotation and then perform the other one (1). So, to get the angle between
Effectively, "this takes away the rotation q1 from q2", and then, getting the axis-angle from the result is trivial. (1): Minor warning: It's not commutative, the order in which you do the multiplication matters. |
Upon doing further research, you should probably implement jWA86's suggestion. |
I'd like to take two quaternions and get a distance value which is the delta between their separate orientations. Any methods to do this I'm overlooking?
The text was updated successfully, but these errors were encountered: