× Didn't find what you were looking for? Ask a question
Top Posters
Since Sunday
I
3
p
2
w
2
y
2
J
2
Q
2
r
2
o
2
e
2
j
2
d
2
T
2
New Topic  
ilovebio123 ilovebio123
wrote...
Posts: 18
Rep: 0 0
11 years ago
I have a vector defined as v1=(0,0,-1)   It under goes 2 rotations defined as Angles A and B.  Angle A is about the X axis, and Angle B is about the Z axis. How can i calculate the new vector given this information? I need to figure it out in terms of A and B since this is going in a program I'm writing for a larger project. Thanks for your help!
Read 294 times
1 Reply

Related Topics

Replies
wrote...
11 years ago
This rotation can be easily accomplished with what are known as direction cosine matrices.  These matrices are single-axis rotations, which when multiplied together, accomplish an entire rotation from one orientation to another.  You often encounter these topics in an attitude dynamics course.  

Note, it is very important that you know which angle you want to rotate through first.  Rotations done in a separate order will often not yield the same results.  Here are the steps to accomplish your rotation.

1.) Define DCM's (direction cosine matrices). Note, these are 3x3 matrices.
 The DCM about the X axis through the angle A.  Call this matrix M1.

[1              0            0
0            cos(A)      sin(A)
0            -sin(A)     cos(A)]

The DCM about the Z axis through the angle B is:  (Call this matrix M3)

[cos(B)   sin(B)       0
-sin(B)    cos(B)     0
0            0             1]

2.  Combine the DCM's to yield a rotation matrix from v1 to v2 (your new vector).  To combine DCM's, we place the first DCM on the right, and every subsequent rotation on the left:  Let the entire rotation matrix be called [V2V1] to read, "to V2 from V1":

[V2V1] = [M3(B)][M1(A]].

3.  With this full rotation matrix, we simply multiply V1 by it to get V2, i.e:

V2 = [V2V1][V1]

Expanded: V2 =
[-sin(B)sin(A)
-cos(B)sin(A)
-cos(A)]

4. If you want to rotate through B first, and then A, V2V1 = [M1(A)][M3(B)] instead.  
So if you just want to code the rotation generically, use the Expanded V2 shown above, it's V1 rotated first by an angle of A about the X axis, and an angle of B about the Z axis.

For cleaner formatted derivation, see:
https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B8omXOGmi-DdNzZlYTUwNDQtNzBkMy00M2U0LTlmOTYtZDAxNzBiZWYzZTEw&hl=en_US
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  1655 People Browsing
Related Images
  
 324
  
 338
  
 343
Your Opinion
Which is the best fuel for late night cramming?
Votes: 234

Previous poll results: What's your favorite math subject?