Rotation confusion

I had a long chat with one of the students the other day about rotation matrices. They had come up in the Engineering Physics course called Dynamics as a way of finding the components of vectors relative to rotated axes. He had some notes scrawled on a piece of paper from one of my MLC tutors, which regrettably were not actually correct for his situation. I know precisely why this happened: rotation matrices are used in both Dynamics and Maths 1B, but they are used in different ways (in fact, there are two different uses just within Maths 1B!). It's high time I made an attempt to clear up this confusion, especially since three more students have asked me about this very issue in the last week!

In Maths 1B, you learn about Linear Transformations, which are a special kind of function that you enact upon vectors in some dimension to produce vectors in some dimension. It turns out that all linear transformations can be described by representing your vector as a column of coordinates and multiplying it by a matrix. Each linear transformation has its own matrix that works for all the vectors it acts upon. Rotations happen to be a type of linear transformation and in two dimensions there is a formula based on the angle you rotate that tells you what the matrix is. I've included just such a matrix in the picture here.

A diagram with two sets of coordinate axes. The first is labelled "BEFORE" and shows three points with the vectors from the origin to there. A green arrow starting from each point shows the direction they will rotate. A note below says "original coords" and has a column vector x, y. The second is labelled "AFTER" and shows the points rotated, with a green arrow ending at each point showing where it rotated from. A note below says "new coords" and has a matrix multiplied by a column vector x, y. The matrix f

One reason this works is because multiplying a matrix by your standard basis vectors of (1,0)T and (0,1)T gives you the first and second columns of your matrix respectively. But multiplying by the matrix has the same effect as the rotation transformation, so to figure out what these columns actually are, all we have to do is rotate the points (1,0) and (0,1). If you do this, then because of trigonometry, you get the two points (cos θ, sin θ) and (-sin θ, cos θ), which are indeed the columns of the matrix.

A set of coordinate axes with the points (1,0) and (0,1) marked. Each has a green arrow curving anticlockwise starting at it labelled theta. A triangle sits in the first quadrant with one edge on the x-axis, and with its hypotenuse ending where the green arrow from the (1,0) ends. Its hypotenuse is labelled 1, its horizontal edge labelled cos theta and its vertical edge lavbelled sin theta. Another triangle sits in the second quadrant with one edge on the y-axis, and with its hypotenuse ending where the gre

Let's just make sure we know what's going on here before we move on: You have a point in the 2D plane, you take its coordinates as a column, you multiply this column by the matrix, and you produce a new set of coordinates, which is a new point. So your matrix in effect moves your point from one place to another. The point with coordinates (1,0) moves to the point with coordinates (cos θ, sin θ); the point with coordinates (0,1) moves to the point with coordinates (-sin θ, cos θ).

So now we have that a rotation matrix has cos θ on the main diagonal, sin θ in the bottom left corner and -sin θ in the top right corner. And it tells you where a point moves to under a rotation of θ anticlockwise. (It's worth noting that it also works perfectly well on the components of vectors imagined as arrows.)

The problem is that over in Dynamics, a rotation matrix does not look quite like this! In particular, the minus sign is in the opposite corner. Why?

The answer is that in Dynamics the rotation matrix is not a description of a transformation of the points or arrows themselves, but a description of how their coordinates change when you transform the coordinate axes. The points themselves don't move at all, it's the coordinate axes that move and we just relabel the points with new coordinates.

A diagram with two sets of coordinate axes. The first is labelled "BEFORE" and shows three points with the vectors from the origin to there. A green arrow starting from each coordinate axis shows the direction they will rotate. A note below says "original coords" and has a column vector x, y. The second is labelled "AFTER" and shows the axes rotated, with a green arrow ending at the end of each coordinate axis showing where it rotated from. A note below says "new coords" and has a matrix multiplied by a col

The reason this works is again because of the standard basis vectors. The point (1,0) has its coordinates recalculated according to the new axes, and its coordinates turn out to be (cos θ, -sin θ); while the point (0,1) also has its coordinates recalculated and its coordinates turn out to be (sin θ, cos θ).

Two overlayed sets of coordinate axes. The first set is dark blue and is arranged east-west and south-north with the points (1,0) and (0,1) marked. The second set are in a lighter blue and share an origin with the first, but are rotated anticlockwise. There are two green arrows curving from the first set of axes to the next, labelled theta. A triangle sits with hypotenuse along the dark blue x-axis from the origin to the point (1,0) and right angle on the light blue x-axis. The side on the light blue x-axis

You may notice that this is precisely what the coordinates would have been if you did rotate the points themselves, but in the opposite direction to the original rotation matrix. This makes sense. If you turn your head to match the new coordinate axes, then this is precisely what has happened. Basically, if you rotate the coordinate axes one way, the points "move" the other way relative to the axes.

And this would be the end of the story, except that in Maths 1B you also rotate coordinate axes, and yet the rotation matrix is somehow still not the same as the one in Dynamics! Why?

The reason is that in Maths 1B we rotate axes in the context of equations of curves, and this is quite a different situation from when you rotate axes in the context of the points themselves.

Imagine I have an equation which describes a curve. A point is part of the curve if its coordinates satisfy the equation, and it's not part of the curve if its coordinates don't satisfy the equation. But what if I relabel all the points with new coordinates according to a new set of axes? I want an equation for my curve so that a point is on the curve if its new coordinates satisfy the new equation. How do I achieve that? Well I do already have an equation, it's just in terms of the old coordinates. So if I have a point in the new coordinates, to tell if it's in the curve, I just need to figure out what the old coordinates are and sub them into the old equation. It ought to be possible to make one equation that encompasses both of these actions – the transferring to the old coordinate system and the subbing into the old equation.

Did you notice what happened there? In order to create an equation that described the same curve relative to the new axes, I had to begin with the new coordinates and transform them into the old coordinates. Let me repeat: I had to go from new to old. The coordinate transformation matrix in Dynamics goes from old to new. To go in the opposite direction I have to have the minus in the opposite corner.

A diagram with two sets of coordinate axes. The first is labelled "BEFORE" and shows an ellipse oriented at an angle to the axes.  A green arrow starting from each coordinate axis shows the direction they will rotate. A note below says "original coords" and has a column vector x, y. The second is labelled "AFTER" and shows the axes rotated, with a green arrow ending at the end of each coordinate axis showing where it rotated from. The curve is still there and the new axes align with the longest and shortest

So that's why the matrices are different. In Dynamics you are moving the axes but not the points, and finding new coordinates for the points. In Maths 1B you are moving the points, not the axes, so the rotation appears to be in the other direction. Or alternatively in Maths 1B you are moving the axes, but you already know the new coordinates and you want the old ones, so you actually are doing the calculation in the opposite direction.

I'm glad we cleared that up!

Tagged in Being a good teacher, Other MLC stuff, Thoughts about maths thinking