Rotations and matrices

Started by
2 comments, last by LilBudyWizer 19 years, 6 months ago
Hi all, I need some clarification on rotation about an axis using matrices. I have one book that describes the rotation around the Z axis as being:

 cos(A)  sin(A)  0   0
-sin(A)  cos(A)  0   0
 0       0       1   0
 0       0       0   1
Now this is in a Row major form. I'm using DX so I have Translated it to a column major form as below:

 cos(A) -sin(A)  0   0
 sin(A)  cos(A)  0   0
 0       0       1   0
 0       0       0   1
But a website that I have seen says that this should be (in column major form):

 cos(A)  sin(A)  0   0
2sin(A)  cos(A)  0   0
 0       0       1   0
 0       0       0   1
This seems to skew the object, not rotate it?? Can anyone enlighten me as to which is correct? Thanks.
Advertisement
that is clearly a stupid typo. the latter is dead-wrong. if you draw these columnvectors youll see they wont span an orthogonal space by a longshot. your own deduction is the correct one.
Cheers. I thought so (my translated matrix created a rotated object that looked correct), but its nice to get confirmation! :)

Thanks again.
An easy way to check or remember the matrices is by what happens to (1,0,0), (0,1,0) and (0,0,1) using trig. Since it is the coordinate axis you don't have to remember the double angle formulas. As an example rotation by t about the z axis takes (1,0,0) to (cos(t),sin(t),0) and (0,1,0) to (-sin(t), cos(t), 0) so those are your first two columns or rows depending upon whether it is Mx or xM.
Keys to success: Ability, ambition and opportunity.

This topic is closed to new replies.

Advertisement