3
$\begingroup$

I have two quaternions, $q_1$ and $q_2$. I want to rotate the axis of rotation of $q_1$ by $q_2$. Is there any way of doing this directly, without extracting the axis of rotation from $q_1$, rotating it and re-inserting it again?

Please note that I am not trying to perform a combined rotation by quaternion multiplication ($q' = q_2q_1$). Instead I want to rotate the axis of rotation of $q_1$.

$\endgroup$
2
$\begingroup$

The whole thing can be done with quaternion arithmetic.

The axis of $q_1$ is $a=\frac{q_1-\overline{q_1}}{2}$, and by computing $q_2aq_2^{-1}$ you will be rotating the vector $a$ into a new direction.

$\endgroup$
  • $\begingroup$ Thank you! This simple fact did not occur to me until you pointed it out! $\endgroup$ – Daniel Peterson May 19 '13 at 20:00
  • $\begingroup$ @DanielPeterson Glad to help! $\endgroup$ – rschwieb May 19 '13 at 20:03
1
$\begingroup$

If $q_1$ can be written as a real $c$ and a vector $a$ (so that $q_1 = c + a$), then using rschwieb's method, you get

$$q_1' = c + q_2 a q_2^{-1} = q_2 (c + a) q_2^{-1} = q_2 q_1 q_2^{-1}$$

where only normalization of a quaternion has been used to manipulate the expression. So what you end up doing is back-rotating the whole system by $q_2^{-1}$, rotating by $q_1$ as originally written, and then rotating again by $q_2$.

$\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.