Now, what's the point of telling you about all these different geometric transformations?

Well, if you want to do any kind of shape alteration,

say of all the pixels in an image, or a face,

or something like that, then you can always make that

shape change out of some combination of rotation,

shears, stretches, and inverses.

That is, if I want to apply a transformation to a vector r. Let's call that A1,

then that will make some first shape change.

Then if I apply some other transformation to that vector that I've then got,

what I've done is I've performed first A1 and then A2.

Now, maybe this isn't so obvious,

let's slow down and do a concrete example.

If I've got a rotation say,

so I take my first set of axes 1 0, 0 1,

if I rotate them by 90 degrees,

down like this say,

my first axis becomes 0 -1,

and my second axis is going to become 1 0.

So, the transformation matrix for my first transformation,

I just write down the columns,

0 -1 1 0.

That's going to be my first transformation matrix.

Now, say I take another transformation, if I do a shear, say

So I take my original axes 1 0, 0 1.

And I'm going to leave the first axis where it is,

so that becomes 1 0.

And I'm going to shear the other axis over like this,

and that's going to become 1 1.

So my second transformation matrix is going to be 1 0, 1 1.

Now, the first transformation takes e1 hat here,

from 1 0 to 0 -1.

So let's see what happens when we apply A2 to that transformed e1 hat.

So A2 is 1 0, 1 1.

When I multiply that out, I get one times zero plus one times -1, so, that's -1.

And zero times zero plus one times -1, equals -1, -1.

So that means that the second transformation, if I do A2

to e1 hat,

that's going to take it down here to -1, -1.

When I do A2 to the transformed version of e1 hat.

And I can do the same for e2 hat,

after I did A1,

it was at 1 0.

And if I apply A2 to that, I multiply that.

I get one times one, plus one times nought.

And then zero times one,

plus one times zero, 1 0.

So that stays at 1 0.

So, my new e2 double prime, if you like.

This was e1 double primed,

this is e2 double primed.

And if I'm being consistent in my notation,

that would therefore be e1 primed,

and that would be e2 primed.

So I take e1, move it to e1 primed,

then move it to e1 double primed.

Now, my axes look like this.

So my original little square has become now a little parallelogram over here.

And the combination of these transformations,

I'm just going to write down what happened.

So the combination of those gives me an overall transformation matrix,

which is just that column followed by the column of e2 double primed, which is that.

So that's equal to A2A1

doing first transformation A1,

then transformation A2.

And this tells us how we do matrix multiplication for instance.

So if I want to know what happens if I do that,

so if matrix multiplication we go about doing the following.

So I write down A1,

0 1, -1 0.

And I write down A2,

1 1, 0 1.

Then matrix multiplication, it's a bit like I do with vectors,

so I multiply the rows times the columns for all the possible rows and columns.

So row times column, do that.

That'll give me the first entry and what will now be.

I can do that for two rows, two columns here.

So I do first row, first column.

One times zero, plus zero times minus one will give me that, minus one.

And I can then do that for the second column.

First row, second column.

One times one, plus one times zero.

I can then do that for the second row, second column.

Zero times zero, plus one times minus one.

And I can do it for the second row, second column.

Zero times one, plus one times zero, zero.

Which is the same as I got by doing

my two-vector transformations of the bases vectors in turn.

So we've discovered how to do the multiplication of

two matrices together as being the composition of the two transformations,

doing the first transformation and then the second.

So we can use that to do any type of transformation we want,

of some combination of rotations and shears and scales.

Now there's one last thing to note,

which is that we need to ask ourselves the question of,

is doing A2 to r and then A1,

the same as doing A1 and then A2?

That is, can we reverse the order in which I do my matrix multiplication?

Well, if I do A2 first, I get this.

And then if I rotate those down by 90 degrees,

if I rotate this guy down by 90 degrees,

he's going to come down like that.

He's going to come down to -1 0.

And if I rotate this guy down by 90 degrees,

he's going to come down like that.

So he's going to become 1 on the x and -1 on the y.

So A2A1 is going to

be -1 0, 1 -1.

And A1 first, followed by A2,

we said was given by this,

-1 -1 and this guy 1 0.

And those two things,

this guy here and this guy here, aren't the same.

And you can see this space here,

this gives me parallelogram here.

And this one here,

gives me something altogether different.

So there is an order dependence to the way in which I do the matrix operations.

So it matters whether I rotate,

then shear, or whether I shear, then rotate.

They're just not the same things.

So we have to be very careful with matrix multiplication.

We can do A1r and then apply A2,

or we can do A2A1

and then apply it to r. But we can't exchange

the order the matrices are in when we multiply it out.

So, in summary, what have we said here?

There seems to be some deep connection between simultaneous equations,

these things called matrices, these guys,

and the vectors we were talking about in the last module.

And it turns out that solving simultaneous equation problems

is appreciating how vectors are transformed by matrices,

and that's the heart of linear algebra.