# Rotations and matrices

This topic is 5460 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

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.

##### Share on other sites
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.

##### Share on other sites
Cheers. I thought so (my translated matrix created a rotated object that looked correct), but its nice to get confirmation! :)

Thanks again.

##### Share on other sites
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.

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 13
• 14
• 40
• 63