Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

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.

share|improve this answer
    
Thank you! This simple fact did not occur to me until you pointed it out! –  Daniel Peterson May 19 '13 at 20:00
    
@DanielPeterson Glad to help! –  rschwieb May 19 '13 at 20:03
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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