If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# 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 let me call let's say I have a vector to the vector 1 2 so my vector looks like this 1 then we go up 2 so my vector looks like this then 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 where T is any real number is any real number so this is just a line with a slope of 2 right you rise 2 for every one you go over so let me draw my line just like this this is nothing new at this point so that's my let me draw it a little bit better than that there you go and it keeps going because obviously we can get negative multiples of my vector and it also goes here so you if you if you look at all of 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's say I have 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 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 V 2 let me call it V 1 V 1 is equal to 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 worth talking 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 them over this line I'm finding the reflection across line now so this is going to be the transformation the transformation of v1 and it would be it would be you know 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 a view 1 it's going to be the negative of that so it's going to be minus 2 minus 2 1 so I know I want to define this transformation I know I want to define this transformation from R 2 to R 2 that is a reflection so the transformation the transformation of some vector X is the reflection the reflection of X around or cross 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 as a linear transformation I don't have to go through go through all of the exercises of this is a linear transformation but in the past if we wanted to find the transformation matrix for linear transformation so let's say we say T of X is equal to some two-by-two matrix because it's the mapping from R 2 to R 2 times X before in the past to find a we would say a is equal to the transformation applied to our standard our first bit standard basis vector so the transformation applied to one zero and then our second column in a would be the transformation applied to zero one and if we were dealing in a in a in RN we would do this end 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 if I have one zero 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 if we were able to be if we were creative with our geometry in our trigonometry we could actually figure this number out and we could figure this number out if I were to flip if I were to flip 1 if I were to flip 0 1 over it would 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 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 or 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 and 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 you know this inclined line the reflection would be around the second coordinates axis it seems like would be a more natural transformation so this leads us to a very interesting thing maybe let me review what we've done in the last couple of videos the last couple of videos we could say look we're in standard coordinates you apply some 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 with respondents 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 D is equal to C inverse times a times C we showed this to video I think was two or three videos ago where C is just the change of basis matrix it's just C is just the matrix that has our new basis vectors as columns and C inverses 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 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 want to you know I've kind of defined my transformation to 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 you know some serious geometry and trigonometry to figure out you know what happens to one zero when I reflect around the line spanned by one two 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 to one and the vectors one two one two 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 bit like that and our new vertical axis 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 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 and 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 let's just experiment a little bit let's label our transformation vectors let's create this is our basis vectors let's create that's V 1 that's the same label I applied to it over here let's save this spanning vector right here of our line that we're reflecting around let's call that V 2 so our new coordinate system has the basis vectors V 1 and V 2 now what is what is the what is V 1 what is V 1 represented in our new basis remember when you transfer to a new basis all it means is how much you have your coordinates your first coordinate now is going to be how much of your first BEC basis vector do you need to get a linear combination of V 1 and how much of your second one well V 1 V 1 we write it here V 1 is just equal to one times v1 plus 0 times V 2 I mean if I wanted to I could have found C inverse and multiplied by it but you can it's almost trivial to find a linear combination of your basis vectors that to get that gets V 1 in fact it's not almost trivial it is trivial V 1 is 1 times v1 plus 0 times V 2 so it's coordinates and in with respect to the basis B are going to be 1 times v1 plus 0 times v2 fair enough now what is D times what is D going to be let's say so we want to let's say we want to find D first because if we can find D we can find D then we can just apply this formula here to figure out a now let's just say let's just say that D is equal to D is equal to it's going to be a two by two vectors still mapping from r2 to r2 these are this is still a two-dimensional space it's going to map within this two-dimensional space so let's say D has just two column vectors D 1 and D 2 just like that so what what is D times this going to give us so let me write it this way D let me scroll down a little bit about I like to show that that little chart right there but D times the B coordinate version of our first basis vector is going to be equal to D 1 D 2 those are the two columns of D D 1 D 2 times V 1 and B coordinates right so it's going times 1 0 now what is this going to be equal to what is this going to be equal to well this is just going to be you know this is just a linear combination of these columns so it's going to be 1 times D 1 1 times D 1 plus 0 times D 2 which is just D 1 so it's the first column of this but what is that also going to equal if I multiply D times the 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 and this is going to be equal to the B coordinate version the B coordinate version of the transformation of the transformation of v1 right if you just put a v1 here instead of an X V ones B version right there times D is going to be equal to the transformation of v1 x' B version or is it with or its coordinates with respect to B so it's just that thing right there now do we know do we know what this so there's a couple of interesting things here we just got that the first column just by applying this you know D times this has got to be equal to this we just figured out that the first column of D right because you take this x 1 0 which is the first basis vectors 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 have to represent if you want to represent V 2 in your new basis well what is it it's 0 times this guy plus 1 times this guy it's 0 times V 1 plus 1 times V 2 so it's going to be 0 1 and you're gonna see this is generally the case and when you think about it's almost it's almost ridiculously obvious that you know obviously if the first basis vector is gonna be 1 times the first basis vector plus 0 times the second basis vector and if you had it you know n basis vectors would be 1 times the first basis vector plus 0 times all of the other ones and if you're in general if you're dealing with let me go to it you know if you're dealing with the nth basis vector and you want it express it in your basis you're essentially going to have you know a bunch of zeros all the way because one times your nth basis vector and then everything else is 0 so this will be the nth term so this applies generally that you know disorder you can call this e and 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 just applying this little you know 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 write rewrite D like this the first column is d 1 which is the same thing as the transformation applied to V 1 our first basis vector in in B coordinates now what is d 2 well let's do the same thing to V 2 to our second basis vector so if I multiply if I multiply D time the second basis vector v2 in B coordinates right in our new coordinate system that is equal to d1 d2 times what is this guy's representation in a 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 D 1 0 times D 1 plus 1 times D 2 which is equal to D 2 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 represents formation of X so this is going to be equal to the B coordinate representation of the transformation of v2 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 it's the transformation of v2 in in B coordinates in B coordinates now is this any easier to find then this stuff up here remember before we said hey 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 what all we wanted to do and we said that's not easy is this any easier well what is the transformation of v1 what is the transformation of v1 let's go back to our original transformation definition this is v1 right here right the transformation of v1 ended up being minus v1 it equals 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 the transformation of v1 if I wanted to reflect it around the line L it just was equal to minus v1 that's because V 1 was orthogonal to the line right that why we picked it if you just take the transformation of this guy just flips over and 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 in B coordinates and B coordinates well minus V 1 minus V 1 is just equal to minus 1 times v1 plus 0 times V 2 so minus V one's coordinates and 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 I'm just going to kind of imagine spinning that vector but it's not going to change the vector at all right so the transformation 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 the transformation of v2 is just going to be equal to v2 as you can see it's we pick 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 and B coordinates we already figured out is 0 1 so this is just going to be 0 1 so now we have our 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 the second column is the transformation of our second basis vector with respect to the B coordinate with respect to B coordinates so it's 0 1 or the B coordinate representation of the transformation of our second basis the language can get convoluted sometimes and that was neat that was easy we've 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 when we have to figure out C and C inverse so C remember C is just the change of basis matrix C is just the change of basis matrix and that all that is is the basis vectors it's just a matrix with the basis vectors in the column in a 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 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 1 over the determinant 1 third times times you swap these dudes right here so this is become 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 we're now 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 this first these two guys first and what do we get we get we're gonna get a 2 by 2 matrix we get 2 times minus 1 plus 1 times 0 so this is going to be minus 2 and then here you get 2 times 0 plus 1 times 1 plus 1 times 1 so you're just going to get right 2 times 0 plus 1 times 1 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 I'm gonna 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 we get 2 times or negative 2 times 2 which is minus 4 let me write it out so I don't make careless mistakes minus 4 2 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 make sure I did that right minus 2 times 2 is 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 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 that 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 see these are our basis vectors right there let's see our basis vectors where the vectors oh well our first basis vector was a vector 2 minus 1 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's 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 C inverse let's see the determinant is going to be 2 times 2 which is 4 minus 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 gonna switch these two guys and then these two guys are going to become negative so this guy is going to become negative this guy is going to be a plus let me rewrite that C inverse 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 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 right this thing wouldn't change actually this will change because C is now 2 minus 1 actually let me just redo this part because I realize that I've made it a bit of a mess and just to go through this and correct this it's a bit hairy it's easier just to redo the whole multiplication I apologize that apologize for wasting your time with my error so a is equal to let me rewrite them to 1 minus 1/2 right 2 minus 1 1 2 that is our bait these are our basis vectors I forgot that minus sign there x 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 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 two times minus one plus one times zero so it's minus 2 2 times 0 plus 1 times 1 is 1 right if 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 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 this 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 I'm sorry a plus 3 right minus 4 is minus 3 and then a plus 3 you can imagine we deal with matrices the 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 minus 3/5 4/5 and then 4/5 3/5 just like that so borrowing my flight arithmetic error when I got from writing down the basis vectors incorrectly forgetting to put that negative number we now hopefully or you realize you can appreciate 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 first time I did the problem