# Transformation matrix

1. Jul 30, 2006

### UrbanXrisis

Find the transformation matrix that rotates the axis $$x_3$$ of a rectangular coordinate system 45 degrees toward $$x_1$$ around the $$x_2$$ axis.

I have a question about what exactly are the $$x_1,x_2,x_3$$ supposed to be. Do I assume that they are the x,y,z axis?

Also, what is the general form of a two-dimensional transformation matrix? I know that there are different ones for rotation, scaling, shearing, and so on. But is there a general form for a 2x2 transformation matrix?

2. Jul 30, 2006

### 0rthodontist

Yes, they are the x, y, z axes. The x1 x2 x3 just refer to three coordinates in your vectors. The x2 axis is all points of the form (0, x2, 0).

The "general form" of a 2x2 matrix is just any 2x2 matrix. Every matrix can be seen as a "transformation matrix."

3. Aug 1, 2006

### UrbanXrisis

$$\left(\begin{array}{c}x \\y\\z \end{array}\right)\left(\begin{array}{ccc} cos45 & 0 & -sin45 \\ 0&1&0 \\ sin25&0&cos45 \end{array}\right)$$

would this be the matrix to rotate the z axis 45 degrees towards the x axis and around he y axis?

4. Aug 1, 2006

### HallsofIvy

Staff Emeritus
Well, (1, 0, 0), on the x-axis, should be rotated to [itex](\frac{\sqrt{2}}{2}, 0, \frac{\sqrt{2}}{2}). Does your matrix do that?

(The answer is "no" for two reasons! First, you are multiplying the matrices in the wrong order. You can't multiply the matrices as you show them. Second, you have a typo, writing one of the angles as "25" rather than "45".)

5. Aug 1, 2006

### UrbanXrisis

this look better?

$$\left(\begin{array}{ccc}x &y&z \end{array}\right) \left( \begin{array}{ccc} cos45 & 0 & sin45 \\ 0&1&0 \\ -sin45&0&cos45 \end{array}\right)$$

6. Aug 1, 2006

### BobG

Surprisingly, yes. But only because you did the inverse of an inverse. It gets you the correct result, but it's not set up in the standard way.

You only have one rotation matrix:

$$\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0&cos \theta& sin\theta \\ 0&-sin \theta&cos \theta \end{array}\right)$$
The '1' should be on the axis you're rotating around (xx, yy, or zz). Shift the rest of the matrix over and down as necessary (rows shifting off the bottom wrap around to the top; columns shifting off the right wrap around to the left).

The vector you're transforming should be written as a 3x1 matrix.

$$\left(\begin{array}{c}x\\y\\z \end{array}\right)$$

Your rotation matrix is multiplied by the vector. Since you're rotating about the y axis, it would look like this:

$$\left( \begin{array}{ccc} cos \theta & 0 & -sin \theta \\ 0&1& 0\\ sin\theta&0&cos \theta \end{array}\right) * \left(\begin{array}{c}x\\y\\z \end{array}\right)$$

The rotation is counter-clockwise. If you want to rotate clockwise, you need to the inverse of the rotation matrix you used. Since you're using an orthogonal rotation matrix, the inverse is just the transpose of the counter-clockwise rotation matrix.

Last edited: Aug 1, 2006