Magnitude of rotation between two quaternions

1k Views Asked by At

I have a quaternion for an object's starting rotation, and a quaternion for an object's ending rotation, and I am SLERPing the shortest rotation between the two.

How can I figure out the magnitude of the rotation between the object's start and end rotations?

1

There are 1 best solutions below

0
On BEST ANSWER

There is a map $q \mapsto R_q$ that maps a unit quaternion to a rotation. It is a homomorphism, that is, $R_a R_b = R_{ab}$. If the starting rotation is $R_a$, and the ending rotation is $R_b$, then the way to go from the first to the second is via $R_b R_a^{-1}$. And this is $R_{b a^{-1}}$.

Compute $a^{-1}$ using the formula $\bar a/|a|^2$. And since $a$ is a unit quaternion, this is $\bar a$, where $\overline{w+ix+jy+kz} = w-ix-jy-kz$.

The trickiest bit will be to realize whether you need $b a^{-1}$ or $a^{-1} b$ (since if you define the map slightly incorrectly, it might be a "reverse" homomorphism).