Rotations about an arbitrary axis
Spencer W. Thomas
spencer at eecs.umich.edu
Sat Jun 2 02:14:04 AEST 1990
In article <1990May31.171937.14296 at watcgl.waterloo.edu> jdchrist at watcgl.waterloo.edu (Dan Christensen) writes:
me> In article <SPENCER.90May22144823 at spline.eecs.umich.edu> spencer at eecs.umich.edu (Spencer W. Thomas) writes:
me> You want to rotate the vector V1 into the vector V2. We can
me>do this in two steps: (1) rotate V1 to the X axis and then (2) rotate
me>the X axis to V2. (Why do this, you say? Because each step is easy.)
> But there is more than one rotation mapping a vector V1 to a vector V2.
> The final result can be oriented in any way about V2. The original
> poster indicated that he wanted the one that rotates about V1xV2,
> ie. the most "direct" rotation. I don't think that your solution
> does this.
> For example, suppose in a right handed coordinate system the poster
> wants to rotate the y axis to the z axis (by rotating about y cross z,
> ie. the x axis). This will map y -> z, z -> -y and x -> x. I believe
> that your solution will map y -> z, z -> -x and x -> -y which is
> probably not what is wanted. (I may have the details wrong, but I
> think the idea is right.)
I agree that the problem, as I stated it, is ill-defined. However, my
solution definitely maps the normal vector onto itself, by
construction. The first matrix takes v1->x, n->z (and m->y), the
second matrix takes (x->v2, z->n (and y->p)). Thus, the normal vector
(rotation axis) remains fixed. Since each matrix is carefully
constructed to be a pure rotation, the result must be a pure rotation.
Let's try it with your example.
1. n = v1 x v2 = (0 1 0) x (0 0 1) = (1 0 0)
2. m = n x v1 = (1 0 0) x (0 1 0) = (0 0 1)
3. R1 = (v1' m' n') = (0 0 1)
(1 0 0)
(0 1 0)
4. p = n x v2 = (1 0 0) x (0 0 1) = (0 -1 0)
5. R2 = (v2) = (0 0 1)
( p) (0 -1 0)
( n) (1 0 0)
6. R1 R2 = (1 0 0)
(0 0 1)
(0 -1 0)
So the final result takes x -> x, y -> z, and z -> -y, as desired.
--
=Spencer (spencer at eecs.umich.edu)
More information about the Comp.sys.sgi
mailing list