Thursday, June 13, 2013

Rotating Vectors

Teacher: Let's start simple, and consider a vector $u_o = (1,1)$, with the usual standard basis vectors $e_1 = (1,0)$ and $e_2 = (0,1)$ in 2D.

Student: Are we going to stay in 2D thoughout?

Teacher: For now, at least. It makes visualization much easier. To begin with, we are going to consider rotation of the vector $u_o$ by an angle $\theta$ to the new vector $u_n$.

Student: I guess the subscripts "o" and "n" stand for "old" and "new". So you mean I should conjure a picture like this?

Teacher: That's excellent. What do we really mean by the vector  $u_o = (1,1)$ in terms of the bases?

Student: I know. I know. We mean $u_0 = 1 e_1 + 1 e_2$. The "co-ordinates" of a vector tell me what linear combination of the basis I should take.

Teacher: Very impressive! You can also write the vector in "matrix notation" as $u_0 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}.$ Remember that the matrix notation implicitly assumes a certain basis. We will revisit this subtle but confusing point later, when we talk about non-standard bases.

Student: Okay. So as long as I use the same basis or co-ordinate system throughout a problem, I don't have to spend too much time thinking about it?

Teacher: Right. Now let us consider the 2 by 2 rotation matrix $Q$, which performs the rotation. One can derive it from pure geometrical considerations. This magic matrix looks like:
$Q = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \\ \end{bmatrix}$
Student: How do I use it?

Teacher: Very simple. To rotate $u_0$ counter-clockwise by an angle $\theta$ just multiply
$u_n = Q(\theta) u_0.$
Student: Cool. Let me try. If I set $\theta = \pi/2$. I get:
$u_n =\begin{bmatrix} 0 & -1\\ 1 & 0 \\ \end{bmatrix} \begin{bmatrix} 1 \\ 1 \end{bmatrix} = \begin{bmatrix} -1 \\ 1 \end{bmatrix} .$

Teacher: Try $\theta = \pi/4$, and tell me what you see?

Student: I get $u_n = (0, \sqrt{2})$. Hmmm.
I see. I see. The length of the vector is unchanged. Both $u_0$ and $u_n$ are of length $\sqrt{2}$.

Teacher: Pure rotation, my friend. The matrix $Q$ is special. A general matrix $A$ would have been less gentle. In general, a 2 by 2 matrix rotates and stretches the vector on which it acts.

Student: Cool! Is there anything else that is special about $Q$

Teacher: Yes! I am glad you asked. $Q$ belongs to a special class of matrices called orthogonal matrices. These matrices have the interesting property that the transpose is the inverse.
$Q^{-1} = Q^T.$

Student: Does that have any relevance to our discussion?

Teacher: Sure it does! Given $u_n = Q u_0$ we can use the property of orthogonal matrices to write $u_0 = Q^T u_n$. That is, we can rotate a vector clockwise by an angle by multiplying by $Q^T$.

Student: Wait a minute. Shouldn't I have to multiply with $Q(-\theta)$, instead of $Q^T$?

Teacher: A rose by any other name is still a rose!

Student: Aha! They are the same matrix.

Teacher
: Excellent. Next time, we'll consider the problem we alluded to earlier. What happens to a vector when we change the basis.