# Rotation matrix

• 08-02-2008
Drogin
Rotation matrix

I read about how you derive the formula for making a matrix to rotate about an arbitary axis.
I understood how they made it, and understood the concept of how to do it.

What I don't quite understand, is how to derive the matrices for the "normal" x, y and z axis.

For example, to rotate about the x-axis, the rotation matrix are:
Code:

```| 1    0          0 | | 0  cos(x)  -sin(x) | | 0  sin(x)    cos(x) |```
The book didnt say how they derived thease matrices.
Of course, to derive them, you could just use the arbitary formula with the basis-vectors.
And that's my question. How did they derive the rotation-matrices for the x, y and z axis?
Is it so simple that they figured it out in their head? Can they see it visually/geometricaly?
Or did they derive the formulas using the arbitary formula?
• 08-02-2008
tabstop
Have you seen a derivation for rotations in 2-D? (Obviously you would get a 2x2 matrix out of that.) This is just the same -- the x-axis doesn't move, since it's being rotated about, so the x-column gets the identity; the y- and z-columns get the 2x2 matrix developed in 2-D. Same for the rotations about y- and z-axes.
• 08-02-2008
Drogin
I've seen 2D-matrices, yes.
But what I was wondering about, wasnt the "identity vector"-part of the 3D-matrix. That I understand easily :)
What I was wondering about was, how did they find out that it should be -sin(x), and not sin(x), and how did they find out it should be sin(x) on the "x-coordinate" of the y-vector, and cos(x) on the y-coordinate of the y-vector.

I understand why when I insert the basis vectors(x, y and z) in the formula for rotation around an arbitary axsis.
But I was wondering if this was how they found out the 2D-matrices for the axis-vectors as well, or if they did something else, like used some weird geometry rules or visualised a rotated unit-circle or something.
• 08-02-2008
BobMcGee123
All a rotation matrix *really* does is re-plot the point with respect to a new coordinate system. It rotates the 'i,j,k' unit vectors used to describe the point in question. I'm a bit surprised that you found the arbitrary axis rotation formulas straightforward but got stumped on the x,y,z axis rotation matrices.

http://cboard.cprogramming.com/showt...light=rotation
• 08-02-2008
VirtualAce
Quote:

I'm a bit surprised that you found the arbitrary axis rotation formulas straightforward but got stumped on the x,y,z axis rotation matrices.
Agreed. The axis-angle rotation matrix is about three times as complex as the standard x,y and z rotation matrices. In fact axis-angle rotation matrix is extremely similar to what quaternions are doing if I recall correctly.

As for quaternions I just started using them and take for granted that they um...'work' since I'm baffled by the underlying math.
• 08-02-2008
Drogin
Quote:

In fact axis-angle rotation matrix is extremely similar to what quaternions are doing if I recall correctly.
The book I'm reading are dealing with rotation-matrices before quaternions...perhaps that's the reason.

And the fact that the book explained the underlying math behind the arbitary formula, but didnt explain how they made the roation around the x,y and z axis

Offtopic:
Quote:

"Those who sacrifice freedom for security deserve neither."
That's Abraham Lincoln, isnt it?
• 08-02-2008
tabstop
Quote:

Originally Posted by Drogin
I've seen 2D-matrices, yes.
But what I was wondering about, wasnt the "identity vector"-part of the 3D-matrix. That I understand easily :)
What I was wondering about was, how did they find out that it should be -sin(x), and not sin(x), and how did they find out it should be sin(x) on the "x-coordinate" of the y-vector, and cos(x) on the y-coordinate of the y-vector.

Then you haven't seen 2D rotation matrices.

Sit down with a piece of paper, pick a point (x,y), draw the ray from origin to there, rotate the ray counterclockwise by some angle theta, and find the coordinates of new point. You'll find the coordinates are familiar.

Note: The arbitrary basis vector method is simply to decide ahead of time to use the points (1,0) and (0,1), since they make things cancel (i.e., all the y-terms cancel in the first, all the x-terms cancel in the second). You can then use those straight down in the columns of the rotation matrix.