Current time:0:00Total duration:28:59

0 energy points

# Changing coordinate systems to help find a transformation matrix

Video transcript

Let's say we're in R2. Let me graph it. Let me draw my vertical
axis, just like that. And then let me draw
my horizontal axis, just like that. And let's say I have
a vector 1, 2. So my vector looks like this,
1, and then we go up 2. So my vector looks like this. Let me draw it. That is my vector. It's the vector 1, 2. And I want to look at
the line that is spanned by this vector. So let me just define some line
L, and it's equal to the set of t times 1, 2, where
t is any real number. So this is just a line with
a slope of 2, right? You rise 2 for every
1 you go over. So let me draw my line
just like this. There's nothing new
at this point. Let me draw it a little
bit better than that. There you go. And it keeps going, because
obviously, you could get negative multiples of my vector,
and it also goes here. If you look at all the points
that are specified by all of the scaled up or scaled down or
negative scaled versions of this vector, you're going to
get all the points on this line if you draw those vectors
in standard position. So this is my line
right there. Now, I want to construct a
linear transformation that reflects around this line. For example, if I have
this vector-- let me draw it like this. Let's say I have that vector
that specifies that point right there. Let me call that vector x. I want the transformation of
x to be essentially the reflection of x around
this line. So if I go in this direction
right here, I want this to be the transformation. I want that to be the
transformation of x, so it should look just like that. I'll do another example. Let's say I have this vector. Let me give you a particular
vector. Let's say I have a vector that's
orthogonal to my line. So let's say I have the vector,
I'll call it v1. And let's see, something that's
orthogonal to it, I can switch these two guys and make
one of them negative. So if I go to the vector 2,
minus 1, so if I have this vector right here, visually
it looks orthogonal. So if I have v2-- let
me call it v1. v1 is equal to 2 minus 1. Visually, it looks orthogonal,
but then even if you actually take the dot product 2 times 1
plus minus 1 times 2, that's going to be equal to 0. So this is definitely orthogonal
to my spanning vector, so it's definitely
orthogonal to every point on that line. But if I apply the
transformation to this guy right here, I'm just going
to flip it over the line. So let me draw it like this. So it's going to be equal to--
it's just going to look like-- let me do it in a green color. So the transformation of this
guy, I'm just flipping him over this line. I'm finding the reflection
across line L. So this is going to be the
transformation of v1, and it would be-- we don't know what
the actual transformation matrix is and that's actually
going to be the subject of this video, but if you just
look at the transformation just for v1, it's going to be
the negative of that, so it's going to be minus 2, 1. So I know I want to define
this transformation. I know I want to define this
transformation from R2 to R2. That is a reflection. So the transformation of some
vector x is the reflection of x around or across, or however
you want to describe it, around line L, around L. Now, in the past, if we wanted
to find the transformation matrix-- we know this is a
linear transformation. I don't have to go through all
of the exercise of this is a linear transformation. But in the past, if we wanted
to find the transformation matrix for a linear
transformation, let's say we say T of x is equal to some
2-by-2 matrix, because it's a mapping from R2 to R2 times x. Before in the past to find A, we
would say A is equal to the transformation applied to our
first standard basis vector, so the transformation
applied to 1, 0. And then our second column in A
would be the transformation applied to 0, 1. And if we were dealing in Rn,
we would do this n times and we would have the
n basis vectors. We've seen this multiple,
multiple times. Now, in the past, when we
were constructing these transformation matrices, finding
these things were pretty straightforward, but
you'll see now it's not that straightforward. If I have 1, 0, if I have the
vector 1, 0, finding its transformation, if I were to
flip it over, it's going to look something like this. And we could do it if we were
creative with our geometry and our trigonometry. We could actually figure this
number out, and we could figure this number out. If I were to flip 0, 1
over, it might look something like that. We could figure it out,
but it's not easy. So let me just write
this down. It's not easy. And we want to at least-- I
mean, you know, we could do this if we had to, but if
there's an easier way, we should at least be exposed
to that easier way. So you might have
an insight here. We've been talking about
alternate coordinate systems, and this transformation, it
looks difficult in our standard coordinate system,
because we're reflecting around this line right there. But what if we defined a
coordinate system where reflection around this line
was more natural? And you might already see an
interesting coordinate system. What if we had a coordinate
system with v1 as one of the basis vectors and then 1, 2
as the other basis vector? Then, all of a sudden, at
least in that coordinate system, the reflection wouldn't
be around this inclined line. The reflection would be around
the second coordinate's axis. It seems like it would be a more
natural transformation. So this leads us to a very
interesting thing. Let me review what we've done in
the last couple of videos. In the last couple of videos,
we could say, look, if we're in standard coordinates, you
multiply by some matrix A and you get the transformation
of x. We've seen that multiple
times. This is in standard
coordinates. And we've also seen that we
could change our coordinates. We can get coordinates with
respect to some other basis. We can multiply x times C
inverse and then we'll get the representation of x or in
coordinates with respect to some other basis, and then we
can multiply that times some other matrix D. And we've seen-- let me write
this down-- that D is equal to C inverse times A times C. We showed this I think it was
two or three videos ago, where C is just the change
of basis matrix. C is just the matrix
that has our new basis vectors as columns. And C inverse is obviously
its inverse. So we can apply D. And then if we multiply D
times this B coordinate version of x, we will get the
B coordinate version of the transformation of x, so the
transformation of x represented in B coordinates. And then, you know, you could
convert back and forth between these guys. You could go this way if you
multiply by C inverse. You could go that way
if you multiply C. We've seen this in
multiple videos. Now, in this particular case
that we're dealing with, I want to find A. I've kind of defined my
transformation in kind of touchy-feely terms. I've just
verbally defined it, but I would like to have a
transformation matrix with respect to my standard basis. But I just showed you
that it's not easy. I'll have to break out some
serious geometry and trigonometry to figure out what
happens to 1, 0 when I reflect around the line
spanned by 1, 2. It's not easy. But what if we change basis? What if we change basis
to some new basis? Let's say we define some new
basis, where our spanning vectors or our basis vectors are
this guy, are the vectors 2, 1, and the vectors 1, 2. So you can almost view that
our new horizontal axis-- obviously, it's not horizontal,
but if you want to think of it this way-- is going
to be like that, and our new vertical axis
is like this. And now in this world, our
transformation is just a reflection around our
new vertical axis. So maybe it'll be easier to find
D, because this might be a simpler transformation in this
other coordinate system. And then if we can find D,
then we can solve for A. We've seen this. A is just equal to C times
D times C inverse. I showed that to you a
couple of videos ago. So let's see if it's
easier to find D. So let's just experiment
a little bit. Let's label our transformation
vectors. Let's say this is-- or
our basis vectors. Let's say that's v1. That's the same label I applied
to it over here. Let's say that this spanning
vector right here of our line that we're reflecting around,
let's call that v2. So our new coordinate
system has the basis vectors v1 and v2. Now, what is v1 represented
in our new basis? Remember, when you transfer to
a new basis, all it means is how much do your coordinates--
your first coordinate now is going to be-- how much of your
first basis vector do you need to get a linear combination
of v1 and how much of your second one? Well, v1-- is just equal to 1
times v1 plus 0 times v2. I mean, if I wanted to, I
could've found C inverse and multiplied by it, but it's
almost trivial to find the linear combination of your basis
vectors that gets v1. In fact, it's not almost
trivial, it is trivial. v1 is 1 times v1 plus
0 times v2. So its coordinates with respect
to the basis B are going to be 1 times v1
plus 0 times v2. Fair enough. Now, what is D going to be? Let's see. Let's say we want to find D
first, because if we can find D, then we can just apply this
formula here to figure out A. Now, let's just say D is
equal to-- it's going to be a 2-by-2 vector. It's still mapping
from R2 to R2. This is still a two-dimensional
space. This is going to map within this
two-dimensional space. So let's say D has just two
column vectors d1 and d2, just like that. So what is D times this
going to give us? So let me write it this way. Let me scroll down
a little bit. I'd like to show that little
chart right there. But D times the B coordinate
version of our first basis vector is going to be equal to
d1, d2-- those are the two columns of D-- d1, d2 times v1
in B coordinates, right? So it's times 1, 0. Now, what is this going
to be equal to? Well, this is just going
to be a linear combination of these columns. So it's going to be 1 times d1
plus 0 times d2, which is just d1, so it's the first
column of this. But what is that also
going to equal? If I multiply D times the B
coordinate version of x, I've just gotten the B coordinate
version of the transformation of x. So this is going to be equal to
the B coordinate version of the transformation of v1. If you just put a v1 here
instead of an x, v1's B version, right there, times D
is going to be equal to the transformation of v1's B version
Or its coordinates with respect to B. So it's just that thing
right there. So there's a couple of
interesting things here. We just got that the first
column, just by applying D times this has got to be equal
to this, we just figured out that the first column of D,
because if you take this times 1, 0, which is the first basis
vector's representation in its own basis, and you're going to
see in general that when you represent these basis vectors
in their own basis, they're going to look just like your
standard basis vectors in this new coordinate system. So when you represented 2, 1 in
your new basis with respect to this, of course, it's 1 times
this plus 0 times this. It's going to be 1, 0. If you want to represent
v2 in your new basis, well, what is it? It's 0 times this guy plus
1 times this guy. It's 0 times v1 plus
1 times v2. So it's going to be 0, 1. And you're going to see this
is generally the case. And when you think about it,
it's almost ridiculously obvious that the first basis
vector is going be 1 times the first basis vector plus 0 times
the second basis vector. And if you had n basis vectors,
it would be 1 times the first basis vector plus 0
times all of the other ones. And in general, if you're
dealing with the nth basis vector and you want to express
it in your basis, you're essentially going to have a
bunch of the zeroes all the way-- because it's 1 times your
nth basis vector, and then everything else
is zeroes, so this'll be the nth term. So this applies generally, or
you could called this en, if you want to call your standard
basis vectors that way. This is a bit of an aside. I just want to show you that
this idea is generalizable. Now, what's useful about this? Well, just applying this little
logic, D times this guy is that guy, we figured out that
the first column of D is equal to the transformation
applied to our first basis vector in B coordinates. So if I wanted to rewrite D, I
could rewrite D like this. The first column is d1, which
is the same thing as the transformation applied to v1,
our first basis vector, in B coordinates. Now, what is d2? Well, let's do the same
thing to v2, to our second basis vector. So if I multiply D times the
second basis vector v2 in B coordinates, in our new
coordinate system, that is equal to d1, d2 times-- what is
this guy's representation in our new coordinate system? It's 0 times v1, plus
1 times v2. It's 0, 1. I wrote it up here. It's 0, 1. So this is going to be equal to
0 times d1 plus 1 times d2, which is equal to d2. And what is that going
to be equal to? If you multiply D times some B
coordinate representation of x, you're going to get the B
coordinate representation of the transformation of x. So this is going to be equal
to the B coordinate representation of the
transformation of v2. And just like that, we see that
column 2 in D, the second column, so this was the first
column, the second column in D is just this guy. It's the transformation of
v2 in B coordinates. Now, is this any easier to find
than this stuff up here? Remember, before, we said,
hey, if we just apply the transformation to the standard
basis vectors, we can get the standard transformation or we
can find the transformation matrix with respect to the
standard basis, and that's all we wanted to do. And we said that's not easy. Is this any easier? Well, what is the transformation
of v1? Let's go back to our original
transformation definition. This is v1 right here. The transformation of v1 ended
up being minus v1. It equals minus v1. So if we wanted to write the
transformation of v1 in B coordinates-- so let me
write this right here. So the transformation of v1,
if I wanted to reflect it around the line L, it just
was equal to minus v1. That's because v1 was orthogonal
to the line, right? That's why we picked it. If you just take the
transformation of this guy, it just flips over and you get
the minus of the vector. So what is this guy, if we want
to apply it, if we wanted to write this in
B coordinates? Well, minus v1 is just equal
to minus 1 times v1 plus 0 times v2. So minus v1's coordinates, in
B coordinates, they're just going to be equal to minus 1
times v1 plus 0 times v2. Remember, these are just the
weights on your basis vector. So this thing right here is
pretty straightforward. This is just going to be equal
to minus 1 and 0, the first column of D. Now, what's the second
column of D? It's the transformation of v2. v2 was the vector that
spanned our line. This is v2 right here. So what happens to v2 when
you transform it? Well, you take the reflection
of something that's on the line, around that line, it's
just going to be the same. Nothing's going to change. You're taking a reflection
around this. You can kind of imagine spinning
that vector, but it's not going to change the
vector at all, right? So the transformation of this
guy, of 1, 2, is just going to be 1, 2. The transformation of v2 is just
going to be equal to v2. Let me write that down. The transformation of v2 is just
going to be equal to v2. As you can see, we've picked
these basis vectors because transforming them was
very natural. It was very easy. So what about this guy, if I
wanted to represent this guy in B coordinates? Well, v2 in B coordinates, we
already figured out is 0, 1. So this is just going
to be 0, 1. So now we have our
transformation matrix D with respect to basis B. It is equal to the
transformation of our first basis vector with respect to
the B coordinates, which is minus 1, 0. And then its second column is
the transformation of our second basis vector with respect
to B coordinates, so it's 0, 1, or the B coordinate
representation of the transformation of our
second basis vector. The language can get convoluted
sometimes. And that was neat. That was easy. We now have solved for D. And now that we've solved for
D, you notice that changing the basis was actually very
natural, and it was very easy to find what D is. And now that we know what D is,
we can now solve for A. We can now solve for the
transformation matrix with respect to the standard basis. So to do that, we have to figure
out C and C inverse. So C, remember, C is just the
change of basis matrix. And all that is is the
basis vectors. It's just a matrix with the
basis vectors in the column. So we have our basis
right here. So C is just 2, 1 and 1, 2. And then what is C inverse? C inverse is equal to-- well,
we have to find that this guy's determinant, so it's
2 times 2, which is 4. 4 minus 1 times 1, so it's 3. So we do one over the
determinant, 1/3, times-- you swap these dudes right here. So this becomes a 2 and a 2,
and then you make these two guys negative. Negative 1, negative 1. That's C inverse. So now we're ready
to solve for A. So A is going to be equal-- let
me pick a nice color here. A is going to be equal to C,
which is 2, 1; 1, 2 times D. D is minus 1, 0; 0, 1 times C
inverse, which is 1/3, 2 minus 1; minus 1, 2. So let's solve this. Let's just do some matrix-matrix
products. So let's do these two guys
first. And so what do we get? We're going to get
a 2-by-2 matrix. We get 2 times minus 1 plus 1
times 0, so this is just going to be minus 2. And then here, you get 2 times
0 plus 1 times 1, so you're just going to get 1, right? 2 times 0 plus 1 times 1. And then here, 1 times minus
1 plus 2 times 0. That's just minus 1. And then you get 1 times
0 plus 2 times 1. That's just 2. And now we're going to have
to multiply this times this guy over here. Let me put the 1/3 out
front, so we can worry about that later. And then let me multiply times
this, so times 2, minus 1; minus 1, 2. And all of this is going
to be equal to A. I'll do it in yellow. So this is going to be another
2-by-2 matrix. And so we get negative 2 times
2, which is minus 4. Let me write out, so I
don't make careless mistakes Minus 4. Minus 2 times 2 plus 1 times
minus 1, so minus 1. That's that term right there. The next term is minus 2 times
minus 1, which is 2 plus 1 times 2, so plus 2. And then let's do this term. Minus 1 times 2 is minus
2 plus 2 times minus 1, which is minus 2. And then finally we have minus
1 times minus 1, which is 1, plus 2 times 2. 1 plus 4. Let me make sure I
did that right. Minus 2 times 2 as minus 4,
1 times minus 1-- yeah, I think I got it. And, of course, we have a 1/3
out front, so this is going to be equal to 1/3 times
the matrix. Minus 4 minus 1 is minus
5, 4; minus 4, and 5. Or it is equal to minus 5/3,
4/3, minus 4/3, and 5/3. That is our transformation
matrix A with respect to the standard basis. Now, let me check something,
because I have a suspicion because I did this before, and I
don't have what I did before in front of me, but I think
I got a different answer. So let me just make sure
I did this correctly. So C, these are our basis
vectors right there. Let's see, our basis vectors
were the vectors-- oh, well, our first basis vector was
the vector 2 minus 1. So that's where my
error came from. My first basis vector was the
vector 2 minus 1 and my second basis vector is the
vector 2, 1. So that obviously is going
to change my C. It won't change anything else,
because we really didn't use this information
anywhere else. So it's going to be 2, minus
1, so C is 2, minus 1. So C inverse, let's see, the
determinant is going to be 2 times 2, which is 4 minus
1 times 1, so it's going to be 4 plus 1. So this is going to be a 5. Sorry for the error. And then we're going to
switch these two guys. And then these two guys are
going to become negative. So this guy's going to
become negative. This guy's going to be a plus. Let me rewrite that. I apologize for the error. C inverse is going to be 2, 1;
minus 1, 2 times 1/5, not 1/3. That's what that negative
1 changes. And so what are we
going to get? There's going to be 2 minus--
this is C inverse right here, so it's going to be 2 minus 1. This is a plus 1 and this
is going to be a 5. And then so this is going to
be a 5 and this is going to be a plus 1. This thing wouldn't change, or
actually, this will change, because C is now 2 minus 1. Actually, let me just redo this
part, because I realize that I made it a bit of a mess,
and just to go through this and correct this
is a bit hairy. It's easier just to redo the
whole multiplication. I apologize about that. I apologize for wasting your
time with my error. So A is equal to-- let
me rewrite them. 2, 1; minus 1, 2, right? 2, minus 1; 1, 2-- these
are our basis vectors. I forgot that minus sign there--
times our vector D, minus 1, 0; 0, 1-- our matrix
D-- times 1/5-- let me just write the 1/5 out here--
times 1/5. This is C inverse, so
we're going to have 2, 1; minus 1, 2. And what is this going
to be equal to? So first we can do these
two guys right there. So it's going to be 1/5 times--
we have 2 times minus 1 plus 1 times 0,
so it's minus 2. 2 times 0 plus 1 times
1 is 1, right? You have minus 1 times minus
1 plus 2 times 0, so that's just 1. And then minus 1 times 0, which
is 0, plus 2 times 1, which is just 2. And then we multiply it times
this guy, 2, minus 1; 1, 2. And what is this going
to be equal to? This is going to be equal to 1/5
times minus 2 times 2 is minus 4 plus 1 times
1: plus 1. And then your next term is
going to be minus 2 times minus 1, which is 2, plus 1
times 2, so it's plus 2. And then we have 1 times 2,
which is 2, plus 2 times 1, which is 2, right? 1 times 2, plus 2 times 1. And then you have
1 times minus 1. You have 1 times minus 1, which
is minus 1, plus 2 times 2, which is 4. So this is going to be equal to
1/5 times-- we have a minus 3, we have a 4, a 4,
and a minus 3. Sorry, a plus 3. Minus 4, a minus 3,
and then a plus 3. You can imagine when you deal
with matrices, arithmetic is what will trip you up. So your matrix A, contrary to
what I found out a few minutes ago, is equal to minus 3/5,
4/5, and then 4/5, 3/5, just like that. So barring my slight arithmetic
error, which I got from writing down the basis
vectors incorrectly, forgetting to put that
negative number, now hopefully, you realize you can
appreciate that we found an easier way to find this
transformation matrix A with respect to the standard basis. You find the transformation
matrix D first in a more natural basis coordinate system,
and then you can solve for A from that. And you get this result down
there, which is hopefully the right answer. If my memory serves me right,
this is what I got the first time I did the problem.