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.

Every rotation in 3D space can be defined by a rotation axis and an angle. Now let's say we have two rotations R1(axis1, angle1), R2(axis2, angle2).

I remember that Rotation operator is closed under composition, so R1(R2(object)) will be a rotation again.

Does anybody know how to find the new axis and angle for R1 o R2?

share|improve this question
    
depending on what on context of the problem, you might compute the eigenspace of eigenvalue 1 (i.e. the rotation axis whose vectors are fixed under that rotation). –  shuhalo Feb 17 '11 at 2:15
    
nice point of view :) –  Nima Feb 19 '11 at 14:34

2 Answers 2

up vote 10 down vote accepted

Once again, the easiest way of doing this (IMHO, at least) turns out to be quaternions: a rotation of $\theta$ about the (normalized) vector $\hat{v} = (v_0, v_1, v_2)$ is represented by the quaternion ${\bf q}=\mathrm{cos}(\theta/2) + \mathrm{sin}(\theta/2)*(v_0{\bf i}+v_1{\bf j}+v_2{\bf k})$; and quaternion multiplication is easy to compute (all you need are the base axioms ${\bf i}^2 = {\bf j}^2 = {\bf k}^2 = {\bf i}{\bf j}{\bf k} = -1$ - note that the latter implies for instance that ${\bf i}{\bf j} = {\bf k}$ by simply multiplying both sides by ${\bf k}$); once you have your resultant quaternion, the axis can be extracted as the (normalized) imaginary part of the result and the angle can be found by taking the arc-cosine of the scalar part. See the Wikipedia page on quaternions and rotations for more details on just how this works.

share|improve this answer
    
Why once again? –  t.b. Feb 17 '11 at 3:08
    
This just feels like the third or fourth question in the last few days where my answer has been 'quaternions'. They're a favorite topic of mine, mind, so I certainly don't mind another chance to extol their virtues! –  Steven Stadnicki Feb 17 '11 at 8:08
    
Thanks, elegant and neat! :-) –  Nima Feb 19 '11 at 14:28
    
Thanks for the link to Wikipedia . Although I knew the mathematics of that page beforehand, I am awed by its quality and the effectiveness of the illustrations (not to mention their sheer beauty). And I agree with you 100% on the virtues of quaternions: they are definitely the best tool for composing rotations. So, +1. –  Georges Elencwajg Aug 7 '12 at 8:21

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.