# Matrix Rotation

1. Jun 12, 2010

1. The problem statement, all variables and given/known data

Suppose that you want to rotate 80 degrees a cube in three dimensional space centered at the point C(2,4,5) about the x-axis. In other words, you want a pitch 80 degrees centered at the point C(2,4,5). Suppose that you want to rotate a vertex of the cube, the point (x,y,z) = (6,7,9) at an 80 degree pitch centered at point C. What is the resulting point (x',y',z')?

2. Relevant equations

Pitch rotation for x-axis:

[1____ 0______0_____0]
[0___cos80___-sin80__0]
[0___sin80____cos80__0]
[0____ 0______0_____1]

and Scaling with respect to the center point (although I do not need to scale the object):

[x'] [1__0__0__xc] [1____0_____0____0] [1__0__0__-xc] [x]
[y'] [0__1__0__yc] [0__cos80 _-sin80__0] [0__1__0__-yc] [y]
[z']= [0__0__1__zc] [0__sin80__cos80__0] [0__0__1__-zc] [z]
[1] [0__0__0__1] [0____0_____0____1] [0__0__0__1] [1]

3. The attempt at a solution

What I did was I went ahead and replaced the scaling matrix (middle) with the pitch rotation matrix..I don't think this is right, because my answers need "6" as the resulting x-component.

Could someone just show me the matrix formula to use for this problem?

2. Jun 12, 2010

### HallsofIvy

Staff Emeritus
Start by translating the cube so that its center is at (0, 0, 0).

That is, given any point (x, y, z) change it to (x- 2, y- 4, z- 5).

Now rotate about the x-axis 80 degrees:
$$\begin{bmatrix}1 & 0 & 0 \\ 0 & cos(80) & -sin(80) \\0 & sin(80) & cos(80)\end{bmatrix}$$

Then translate back: change the new (x, y, z) to (x+ 2, y+ 4, z+ 5).

That appears to be exactly what you have done, using "projective" notation. That certainly will give "6" as the resulting component. Multiplying
$$\begin{bmatrix}1 & 0 & 0 & -2 \\ 0 & 1 & 0 & -4 \\ 0 & 0 & 1 & -5 \\ 0 & 0 & 0 & 1\end{bmatrix}\begin{bmatrix} 6 \\ 7 \\ 9\end{bmatrix}$$
will give x component 6- 2= 4, multiplying by the rotation matrix will not change that, and multiplying by the third matrix gives 4+ 2= 6 again.

3. Jun 12, 2010

I'm afriad I might be doing something wrong..Let me show exactly what I do step by step:

I am translating the object to the origin using the stack:

[1__0__0__2]__[1____0__ _____0____0]___[1__0__0__-2]__[x]
[0__1__0__4]__[0___cos80__-sin80___0]___[0__1__0__-4]__[y]
[0__0__1__5]__[0___sin80___cos80___0]___[0__0__1__-5]_[z]
[0__0__0__1]__[0_____0______0_____1]___[0__0__0__1]__[1]

Multiplying matrices from left to right until I get down to a single matrix:

[1___0______0________0_] [6]
[0__0.173__-0.985__-1.617] = [-9.271]
[0__0.985__0.173___0.195] [8.647]
[0____0______0_______1_] [1]

The only answer that is even close is: (6, 0.582, 8.649)

But I don't want to guess, I want to know.

Last edited: Jun 12, 2010
4. Jun 13, 2010

### HallsofIvy

Staff Emeritus
Why are you guessing? If you have done your multiplications correctly, that answer is right.

As a check, try multiplying the first matrix on the right by [x, y, z, 1], the the next, then the third (which is the way I would have multiplied to begin with).