Multiplying: one map, then another
By Amiro
How to multiply matrices: doing one linear map after another is again a linear map, whose matrix is the product, read from right to left. Shear then turn lands somewhere else than turn then shear, so the order matters.
A lesson of Linear Algebra
Transcript
- 0:00 Last time, we saw that a matrix is a move of the plane: its columns are where i hat and j hat land. So what if we move the plane twice: first with one matrix, and then with another? Do we get a matrix again?
- 0:14 Let's use two moves we've met. Back to the start, and here's the shear S: it leaves i hat where it is, and sends j hat to one, one. And here's a quarter turn, which we'll call R: it turns the whole plane a quarter turn to the left, so i hat goes to zero, one, and j hat to minus one, zero. We'll follow i hat, j hat, and the little square between them.
- 0:38 First the shear, and then the turn. Where did i hat end up? The shear left it at one, zero, and the turn took it up to zero, one. And j hat: the shear sent it to one, one, and the turn took that on to minus one, one.
- 0:53 Lines still stay straight, parallel and evenly spaced, and the origin stays put, so the two moves together make a single linear map. Its matrix has those landing places as its columns: zero, one and minus one, one. We call it R times S, the product of R and S. Notice the order. Applied to a vector v, R S v means R applied to S v: S acts first, because it's next to the vector, then R. So the chain above reads left to right, but the product reads right to left.
- 1:28 Now the other order: first the turn, and then the shear. Let's go back to the start, and keep the first result dashed. Where will i hat end up this time? Pause the video, and follow it: the turn first, then the shear.
- 1:46 Let's see. First the turn: i hat goes up to zero, one. Then the shear slides it over, to one, one. And j hat: the turn sends it to minus one, zero, and the shear leaves it there, because it lies on the x-axis, which the shear doesn't move. So S times R has columns one, one and minus one, zero.
- 2:09 Now compare. The dashed arrows show shear, then turn. The solid ones show turn, then shear. They land in different places, and the squares end up different too. R S is not the same as S R. With numbers, order never matters: two times three is three times two. With moves of the plane, it can, and here it does.
- 2:32 Here's a quick way to find a product without drawing. Each column of R S is R applied to the matching column of S. S sends i hat to one, zero, and R turns that into zero, one. S sends j hat to one, one. That's i hat plus j hat, so R turns it into zero, one plus minus one, zero, which is minus one, one. Those are exactly the columns of R S, the dashed arrows.
- 3:00 So multiplying matrices means doing one map after another. R S means S first, then R, and its columns are where i hat and j hat end up after both moves. And the order matters: R S and S R are different maps.
- 3:16 Some moves stretch or squash the plane. These two kept the little square's area the same, but others don't. So what happens to areas when we move the plane? That's next time.
More explanations on Sifr