# Rotate Vector

• Feb 1st 2011, 05:13 AM
spyzip
Rotate Vector
I have pont1(x1,y1,z1) and point2(x2,y2,z2) describing a vector.
How do I fined the angle of rotation by x,y,z

Attachment 20659

The red object is ilustration of the vector.
Its hight is caluculated and it is the distance between point1 and point2.
I want to rotate this object so that the top of it drops on point1.
Thanks!!!
• Feb 1st 2011, 05:19 AM
Ackbeet
You have a left-handed coordinate system there, which is going to muck everything up. (Left-handed coordinate systems exist, but I am not at home in them.) I suggest you redraw it so that $\displaystyle \mathbf{i}\times\mathbf{j}=\mathbf{k},$ as in a proper right-handed coordinate system.
• Feb 1st 2011, 06:10 AM
spyzip
Is that ok?Attachment 20660
• Feb 1st 2011, 06:15 AM
Ackbeet
Check out this web page. You can find the angle between the straight-up vector and the vector from 1 to 2 by using the dot product or cross product method. I'd recommend the cross product method, because if you compute the cross product, you'll have the axis about which you want to rotate the line, and you can plug that into the web page to which I linked.

Cheers.
• Feb 1st 2011, 10:28 PM
spyzip
Thanks a lot for your answer, bu my problem is that I'm not very good at math, and I wrote a huge script and this now is the break pint. I really be thankful if you help me some more.
• Feb 2nd 2011, 03:20 AM
Ackbeet
Out of curiosity, what is the script for?
• Feb 2nd 2011, 11:11 PM
spyzip
it is MaxScript, for 3D graphics and animations.

Can I use one of these matrixes Rotation matrix - Wikipedia, the free encyclopedia