Jump to content
• Advertisement

# Quaternions, dot product, derivatives?

This topic is 911 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

## Recommended Posts

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?

#### Share this post

##### Share on other sites
Advertisement

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.

Edited by BBeck

#### Share this post

##### Share on other sites
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.

#### Share this post

##### Share on other sites

• Advertisement
• Advertisement

• ### Popular Contributors

1. 1
2. 2
3. 3
Rutin
15
4. 4
5. 5
• Advertisement

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633725
• Total Posts
3013558
×

## Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!