1
$\begingroup$

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?

$\endgroup$
1
$\begingroup$

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).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.