# SLERP question?

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

## Recommended Posts

I have 2 questions regarding slerp 1) When slerping between 2 quaternions, q1 and q2, the angle between them is cos(theta) = q1(Dot)q2. This may be a simple question, but does anyone know where this formula is coming from? 2) One formula for slerp is q1(q1^-1,q2)^t. Can anyone please explain how this formula is derived? Thanks in advance!!

##### Share on other sites
Quote:
 One formula for slerp is q1(q1^-1,q2)^t. Can anyone please explain how this formula is derived?
I think you mean for the terms in parentheses to be multiplied, rather than separated by a comma, correct?

In any case, let's say you have two scalars, a and b, and you want to interpolate between them. One way to do it is to find the difference from a to b, and then add a fraction of that difference to a, like this:

a + (b - a)t

Similar constructs exist for matrices and quaternions. We just have to figure out what we mean by 'difference' and 'fraction of' for each.

For two orientations, the 'difference' between them is an axis-angle rotation which rotates from the first orientation to the second. With both matrices and quaternions this rotation can be solved for using inversion. So in your formula, the (q1^-1*q2) term is the 'difference' between q1 and q2, and corresponds to (b - a) in our linear example.

Furthermore, we combine quaternion rotations by multiplication rather than addition, and we get a 'fraction' of a quaternion by taking it to a power rather than scaling its components linearly.

So now we can write the two equations together:

a + (b - a)t

q1*(q1^-1*q2)^t

And you can see that it's the same general concept.

Now I'm no mathematician, and there are others on this board who will be able to give you a much more rigorous explanation. But maybe the above will be helpful to you as well.

• 12
• 9
• 13
• 41
• 15