Advertisement

Quaternions, dot product, derivatives?

Started by June 12, 2016 09:20 PM
1 comment, last by alvaro 8 years, 3 months ago

I've got a few questions regarding quaternions:

1 - What does "angle between quaternions" mean?

2 - What does a dot product between quaternions mean.

For my animation importer I did a small trick in order to reduce redundant key frames. I compute the derivative of Translataion/rotation/scaling data and if that derivative is the same as the one for the previous point, I remove that point. of course for quaternion the derivatives shouldn't (or should it) be (q1 - q0) / dt, any ideas how the derivative should be computed?

I would assume that the "angle between quaternions" means the angle between two 3D orientations, which really has nothing to do with quaternions other than that the orientations are stored as quaternions. In game programming, I would bet my next paycheck that's what it means. (Probably the best way to think of game quaternions is as an arrow inside a sphere that points to a position on the sphere's surface, and another tiny arrow on the first arrow's tip that describes what direction to face on the sphere's surface. That second arrow is what makes a quaternion more powerful than a vector in describing orientation. So the "angle between quaternions" would likely be the difference between the two quaternions.)

Is a quaternion dot product an actual thing? This is the first I've ever heard of it.

I don't know calculus and so I can't help you there. Game quaternions, matrix algebra, and vectors yes, calculus no. Wish I did, just not bad enough to live in a calculus book for a year.

Advertisement
This webpage seems to have the information you seek.

However, I'll tell you how I think about it.

If you have two quaternions, q = w + xi + yi + zk and q' = w' + x'i + y'j + z'k, that represent attitudes, the rotation that transforms q to q' is q'/q.

q'/q = (w + xi + yj +zk) / (w' + x'i + y'j + z'k) = (w + xi + yj +zk) * (w' - x'i - y'j - z'k)

If you compute the real part of that product, it's just w*w' + x*x' + y*y' + z*z'. We'll call that the dot product of q and q'. As you see, it can be seen as cos(theta/2), where theta is the angle that BBeck talks about.

I am not sure if people think of "the angle between quaternions" as theta or as theta/2, because acos(q.q') is a common definition of angle. So I can see arguments for either one.

This topic is closed to new replies.

Advertisement