# Rotation of vector

I'm reading Anton's Elementary Linear Algebra. I have come upon the rotation matrix.

$\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}$

They start the discussion with the fact that $T(e_1) = T(1,0) = (\cos \theta, \sin \theta)$ and $T(e_2) = T(0,1) = (-\sin \theta, \cos \theta)$.

This makes sense to me. But why do you need both $e_1$ and $e_2$ ? What about $e_3$ to rotate a vector in 3 dimensions?

EDIT

More specifically, I'm wondering about rotation in 3 dimensions.

$\begin{bmatrix} \cos \theta & -\sin \theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1\end{bmatrix}$

$\begin{bmatrix} 1 & 0 & 0\\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta\end{bmatrix}$

$\begin{bmatrix} \cos \theta & 0 & \sin \theta \\ 0 & 1 & 0 \\ -\sin \theta & 0 & \cos \theta\end{bmatrix}$

I see that both z-axis rotation and x-axis rotation follow the pattern of $\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}$

Why is the rotation about the y-axis different?

• What do you mean need? They have these things, and they are useful to explain what the transformation does... in what way do you think they are needed? – rschwieb May 3 '17 at 13:58
• $e_1$ and $e_2$ are probably the basis vectors in the trivial orthonormal basis. If you want to be able to represent 2 real numbers like for example coordinates in 2D a vector space of at least 2 dimensions would be convenient (for most applications). – mathreadler May 3 '17 at 14:21
• It is not different ! It follows exactly the same pattern, insert row+column with 1 on the diagonal and pad with 0 everywhere else. If you imagine erasing the cross of 0s and 1 you will get the same $2\times 2$ matrix. – mathreadler May 3 '17 at 14:34
• ok I see what you're saying @mathreader. But I'm having a problem seeing this geometrically. For both z and x the pattern in the first row is $\cos\theta , -\sin\theta$, however, for y it is $\cos\theta , +\sin\theta$ – mike May 3 '17 at 14:37
• Ah the sign! I didn't notice. Well it depends on the orientation you want to rotate around the axis ! Do you in the text have any specification of which way the rotation is supposed to be done? Geometrically the sign is the same difference as which way screwing in or out when doing carpentry. – mathreadler May 3 '17 at 14:44

The first part of your question makes no sense to me. However, with your edit:

Why is the rotation about the y-axis different?

The things to notice is how exactly the $2D$ rotation relates to the $3D$ rotation. With the rotation about the $z$-axis, $e_1,e_2$ play the role of the "$x,y$ axes" from $2D$. If we switched $e_1,e_2$, that is, if instead we used $e_2$ as our "$x$-axis" and $e_1$ as our "$y$-axis", we would end up with $$\pmatrix{\cos \theta & \sin \theta & 0\\ -\sin \theta & \cos \theta & 0\\ 0 & 0 & 1}$$ With the rotation about the $x$-axis, $e_2,e_3$ play the role of the $x,y$ axes in $2D$. Because we keep them in numerical order, we get the expected submatrix.

With the rotation about the $y$-axis, $e_3$ plays the role of the $x$-axis and $e_1$ plays the role of the $y$-axis. That is, the numerically higher $e_3$ comes first. If we switched these roles, we would have ended up with the matrix $$\pmatrix{\cos \theta & 0 & - \sin \theta\\ 0 & 1 & 0\\ \sin \theta & 0 & \cos \theta}$$ which is what you were expecting.

So why is $e_3,e_1$ the "correct order"? It has to do with what "counterclockwise" means in $3$ dimensions. $e_1,e_2,e_3$ form a right-handed coordinate system, so a counterclockwise rotation in the $1,2$ plane should go from $e_1$ to $e_2$, and similarly a counterclockwise rotation in the $1,3$ plane should go from $e_3$ to $e_1$.

• But this needs to be specified in the text to make any sense and it depends on if you work in a left or right oriented system. – mathreadler May 3 '17 at 15:03

The easiest way to understand what a linear transformation does is to pay attention to what it does to a fixed basis.

In this case, they've just chosen the most familiar basis $e_1$ and $e_2$. By drawing where these two things land and comparing that to where they started, you can see what the transformation did to the plane.

What about $e_3$ to rotate a vector in $3$ dimensions?

Well, yes, if we were talking about a $3\times 3$ rotation matrix, then you could map all of $e_1,e_2,e_3$ to their images and do the same thing. But that is not relevant for a rotation of the plane...

I think I figured it out. I think this has to do with the fact that this is from the computer graphics section of the book and in this world the z-axis is defined as negative z pointing into the screen, and positive z pointing away from the screen.

During a rotation about the z-axis, $e_1$ is rotated into the 1st quadrant as $\theta$ goes from $0^\circ$ in the positive direction (counterclockwise). $e_2$ is rotated into the second quadrant in the same manner. That is why $T(e_1) = T(1,0) = (\cos \theta, \sin \theta)$ and $T(e_2) = T(0,1) = (-\sin \theta, \cos \theta)$.

However, a rotation about the y-axis in computer graphics rotates $e_1$ towards the -z direction (into the 4th quadrant) or from left to right when looking at an object from the conventional viewer's perspective (on the positive z axis looking towards the negative z axis). And so $T(e_1) = T(1,0) = (\cos \theta, -\sin \theta)$ and $T(e_2) = T(0,1) = (\sin \theta, \cos \theta)$.