Xref: utzoo comp.sys.sgi:4242 comp.graphics:11769 Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!umeecs!zip!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: comp.sys.sgi,comp.graphics Subject: Re: Rotations about an arbitrary axis Message-ID: Date: 1 Jun 90 16:14:04 GMT References: <9005171647.AA14106@baby.swmed.utexas.edu> <1990May31.171937.14296@watcgl.waterloo.edu> Sender: news@zip.eecs.umich.edu Organization: University of Michigan EECS Dept Lines: 46 In-reply-to: jdchrist@watcgl.waterloo.edu's message of 31 May 90 17:19:37 GMT In article <1990May31.171937.14296@watcgl.waterloo.edu> jdchrist@watcgl.waterloo.edu (Dan Christensen) writes: me> In article spencer@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@eecs.umich.edu)