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

Transformation matrix with respect to a basis

Finding the transformation matrix with respect to a non-standard basis. Created by Sal Khan.

Want to join the conversation?

  • leafers tree style avatar for user Filipe Gama
    Ok this might sound really stupid, but i can't really figure out why on earth we need a different transformation matrix if we have our input in a different basis.

    Let's see if I can explain this with a comparison, to simplify things. Let's say that in real life I want to have a pc (my tansformation matrix) which duplicates my words, so if I say for exemple "hello" he will speak "hello hello". Now why would matter if I said those words in any other language? Like if I said "ola" my pc would reproduce "ola ola" , why would he care if it was english or portuguese? Shouldn't the process be exactly the same? Shouldn't the matrix do exactly the same to the coordinates, independently from what basis they refer to?

    Any help would be truly appreciated as I have my next algebra test 3rd January already. Thanks
    (8 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user Andrew
      pretty much, it doesn't work like that. It's not that you want the result to be the same type of thing, you want the result of the transformation to be invariant, meaning that the object is the same, but the way you represent it might be different. Think like youre in chemistry, and you need to do something with a gas, like cow farts (just to make this interesting). The thermometer measures in Celsius but you need kelvin to do the calculations properly (just the way PV=nRT works). You simply add C+274=K. But if you measured in farenheit, you would need to do something completely different to convert to Kelvin. 5/9*(F-32)+274=K. You don't realize it, but youre changing basis when you convert units because youre changing literally how far apart the tic marks on the ruler (or coordinate axis) are. not every unit converts the same, neither does every coordinate system. I can throw a flaming ball of monkey poo 1600m or 1 mile or 1.6km or 160,000cm or 5249 feet but youre not converting the same way every time or you'll get the same number each time which is not right.
      (37 votes)
  • piceratops ultimate style avatar for user Jack Dinkel
    Just to clarify, (C^-1 * A * C) is not the same as (C^-1 * C * A) right? In other words, this expression can not just simplify to A?
    (11 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user jorgedudicoff
    What about T:R^n->R^m
    where there are 2 different bases?
    Whats the difference, and how do you look at these types of matrices.
    My textbook denotes this as [T]alpha beta; where alpha is the basis for Rn and beta is the basis for Rm. The alpha is above the beta.
    (6 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam red style avatar for user Bernard Field
      Let A be the change of basis matrix for our basis in Rn, and B be the change of basis matrix for our different basis in Rm, and T be the transformation matrix in standard bases.
      T acts on a vector in Rn.
      T x = T B [x]_B
      This product is a vector in Rm.
      [T x]_A = A^-1 T x = A^-1 T B [x]_B
      Thus, we have our transformation matrix which takes us from one basis to another.
      A^-1 T B
      (2 votes)
  • blobby green style avatar for user benjamin_treitz
    Again :
    How do I get from [x]B to [Ax]B ?? that is [x]B = [Ax]B algebraically?
    (3 votes)
    Default Khan Academy avatar avatar for user
    • spunky sam red style avatar for user Bernard Field
      Sal is not saying that [Ax]_B = [x]_B. He wrote that D[x]_B = [Ax]_B.

      We have the rule that some vector v can be expressed in alternative coordinate systems by:
      C [v]_B = v, and [v]_B = C^-1 v.
      Ax is some vector. Therefore, we can apply the rule to it.
      x is also some vector. Therefore, we can apple the rule to it.
      (4 votes)
  • blobby green style avatar for user Ronald Melendrez
    My book says A' = TAT-1
    And A = T-1 A'T
    Where A' is the matrix rep in another basis and A is the matrix rep in standard order basis and T is the transformation matrix that takes us from standard order basis to another one.
    I know matrix mult is not commutative in general so which is correct because Khan says D = C-1 A C
    Where D is the matrix representation in another basis C is the change of basis matrix from Standard order to the new one.
    My book says that if we go from { e1, e2, e3 } to { e1', e2', e3' } then T is the transform which changes our basis and that it operates like this
    [e1 e2 e3] = [e1' e2' e3'] T

    If feels backwards can someone clarify and help me with this confusion.
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Tsering Dolkar
    Let P2 be the space of all at-most-quadratic polynomials, with basis B = {x^2, x, 1}. Consider the following transformations D : P2 → P2 and T : P2 → P2:
    Df(x)= f'(x), the derivative; Find the matrix for D with respect to the basis B. I don't get the question.
    (2 votes)
    Default Khan Academy avatar avatar for user
    • primosaur ultimate style avatar for user Derek M.
      It is asking you to find the matrix of D with respect to the basis B={x^2, x, 1}.
      In this case, we do this by taking the transformations of each vector in the basis respectively, and observing how they can be represented as linear combinations of the basis B (specifically, we are interested in the scalars).
      D(x^2) = 2x = 0*x^2 + 2*x + 0*1
      D(x) = 1 = 0*x^2 + 0*x + 1
      D(1) = 0 = 0*x^2 + 0*x + 0*1

      The matrix A of a transformation with respect to a basis has its column vectors as the coordinate vectors of such basis vectors. Since B = {x^2, x, 1} is just the standard basis for P2, it is just the scalars that I have noted above.

      A=
      [0 0 0]
      [2 0 0]
      [0 1 0]
      (2 votes)
  • blobby green style avatar for user Michelle Chen
    At , can you clarify what it means for vector x to be represented with different coordinate systems and what exactly is the standard basis or standard coordinate system?
    (1 vote)
    Default Khan Academy avatar avatar for user
    • aqualine ultimate style avatar for user Kyler Kathan
      The standard basis vectors for Rⁿ are the column vectors of the n-by-n identity matrix. So if you're working in R³, the standard basis vectors are [1 0 0], [0 1 0], and [0 0 1], also known as î, ĵ, and k̂.

      If you have a vector, for example [1 2 3], this can be represented as 1î+2ĵ+3k̂ or 1[1 0 0]+2[0 1 0]+3[0 0 1]. If you decided to use a different set of vectors for your basis such as [1 0 0], [0 2 0], and [0 0 3], then your original vector could be re-written as 1[1 0 1]+1[0 2 0]+1[0 0 3] or, in this new coordinate system, the vector is simply [1 1 1].

      So what you get is x⃑ = [1 2 3] and [x⃑]B = [1 1 1]. The different basis vectors give you a different coordinate system to represent the same thing.
      (3 votes)
  • blobby green style avatar for user candace
    how do you solve translation matrix
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Tzlil Eliyahu
    i need to find the representing matrix of the transformation according these basis...how i do that?
    B ={(1,0,0), (0,1,1), (2,1,0)} E ={(1,0,0), (0,1,0), (0,0,1)}
    T : R3 ->R3
    T(x, y, z) = (x - 2y, y + 2z, x - 2z)
    (2 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user chibuezebrokoro
      hey man
      i know it's been a while but for anyone else wondering
      let's first represent the transformation T in respect to standard coordinates:
      T[x; y] = [ 1 -2 0; 0 1 2; 1 0 -2][x; y]

      Now let's figure out the transformations of the B basis with respect to the E basis. First, with respect to the standard basis we have
      T(1, 0, 0) = (1, 1, 1) // T(0, 1, 1) = (-2, 3, -4) // T(2, 1, 0) = (0, 1, 2)

      Now use the coordinate map to express these transformations with respect to E:

      [1 0 1; 0 1 0; 0 0 1][a; b; c] = [1; 1; 1], etc.

      Since here E is the standard basis you're just gonna get the same thing back, so answer should just be a matrix having column vectors (the transformations above). However if it were some other matrix you'd have to compute those [a; b; c] guys :)
      (1 vote)
  • blobby green style avatar for user kevinkarnani
    When we change our coordinates with respect to a basis, why aren't we required to find the unit vectors? We know that i, j, and k are unit vectors because they have a length of 1. In the case of R^2, What allows us to use a basis like <3,2> and <2,3> where the length of each vector is not 1?
    (1 vote)
    Default Khan Academy avatar avatar for user

Video transcript

Let's say I've got some linear transformation T that is a mapping from Rn to Rn. So if this is its domain, which is just Rn, then its codomain is also Rn. If you give me some vector in our domain, let's call that vector x, then T will map it to some other member of Rn, which is also the codomain. So it'll map it over here. We could call that the mapping of T, or the mapping of x, or T of x. Since T is a linear transformation, we know that the mapping of x to its codomain is equivalent to x being multiplied by some matrix A. So we know that this thing right here is equal to some matrix A times x. You've seen all of this multiple, multiple times. Just to make sure we understand the wording properly, we said we've used the word that A is the-- we could either call it the matrix for T, or let's say it's the transformation matrix for T. Now, in the last couple of videos, we've learned that the same vector can be represented in different ways. It can be represented in different coordinate systems. When I just write the vector x like that, we just assume that it's being represented in standard coordinates, or it's being represented with respect to the standard basis. So let's be a little bit more particular. This A is the transformation for T only when x is represented in standard coordinates, or only when x is written in coordinates with respect to the standard basis. So let me write a little qualifier here. A is the transformation matrix for T with respect to the standard basis. I never wrote this blue part before. I never even said this blue part before, because the only coordinate system we were dealing with was the standard coordinate system or the coordinates with respect to the standard basis. But now we know that there are multiple coordinate systems. There are multiple ways to represent this vector. There are multiple ways to represent that vector, because Rn has multiple spanning bases. There are multiple bases that can represent Rn, and each of those bases can generate a coordinate system where you can represent any vector in Rn with coordinates with respect to any of those bases. So that last part I said was a bit of a mouthful, so let me make it a little bit more concrete. Let's say that I have some basis B that's made up of n-- it has to be linearly independent. That's the definition of a basis-- of n vectors v1, v2, all the way to vn. Now, these are n linearly independent vectors. Each of these are members of Rn. So B is a basis for Rn, which is just another way of saying that all of these vectors are linearly independent and any vector in Rn can be represented as a linear combination of these guys, which is another way of saying that any vector in Rn can be represented with coordinates with respect to this basis right there. So the same vector x, I'm going to put the same dot here. When we represent it in standard coordinates, it's just going to be that right there, that vector x. But what if we want to represent it in coordinates with respect to this new basis? Well, then that same vector x will look like this. We would denote it by this. The same vector can be represented with respect to this basis. This could be some set of coordinates. This would be some other set of coordinates, but it's still representing the same basis. Likewise, this vector right here, that vector right there, is also in Rn. So it can be represented by some linear combination of these guys, or you can represent it with coordinates with respect to this basis. So that same point right there, I could represent it. So that point is this. But I could represent it with coordinates with respect to my basis just like that. So this is an interesting question. This should maybe bring an interesting question into your brain. If I start off with something that's in standard coordinates, and I apply the transformation T-- that's like applying this matrix A to it or multiplying that thing in standard coordinates times the matrix A-- I then get the mapping of T in standard coordinates. Now, what if I start off with that thing in nonstandard coordinates if I have coordinates with respect to this other basis here? Well, T should still map it to this guy. The transformation, no matter what, should always map from that dot to that dot. It shouldn't care what your coordinates are. So T should still map to that same exact point. T should still be a linear transformation. It can map from x to T of x, but that's the same thing as mapping from this kind of way of labeling x to this way of labeling x. So we could say maybe this guy right here could be some other matrix times this guy over here. So let me write this over here. These are just different coordinate systems. I shouldn't just even say maybe. This guy should be able to be represented. So if I represent the mapping of x in our codomain in coordinates with respect to B-- so that's what that guy is right there-- so if I want to represent that dot with this other coordinate system, coordinates with respect to this basis, it should be equal to the product of some other matrix. Let me call that other matrix D. Some other matrix D times this representation of x times the coordinates of x with respect to my alternate nonstandard coordinate system. I should be able to find some matrix D that does this. Then we would say that D is the transformation matrix for T. A assumes that you have x in terms of standard coordinates. Now D assumes that you have x in coordinates with respect to this basis, so with respect to the basis B. There's no reason why we shouldn't be able to do this. These things are just different ways of representing the exact same vector, the exact same dot in our sets here. So if I represent it one way, the standard way, I multiply by A, and I get Ax. If I represent it in nonstandard coordinates, I should be able to multiply it by some other matrix and get another nonstandard coordinate representation of what it gets mapped to. So let's see if we can find some relation between D and between A. So we learned a couple of videos ago that there's a change of basis matrix that we can generate from this basis. It's pretty easy to generate. The change of basis matrix is just a matrix whose columns are these basis vectors, so v1, v2-- I shouldn't put a comma there. These are just the columns-- v2 all the way to vn. This is an n-by-n matrix. Each of these guys are members of Rn and we have n of them. This is an n-by-n matrix where all of the columns are linearly independent, so we know that C is invertible. These are column vectors right here. So we know that C is invertible. We learned in the last two or three videos that if we have some vector x, and it's being represented by coordinates with respect to our basis B, we can just multiply that by C, and we'll get our vector x. This essentially will tell us the linear combination of these guys that'll get us x. Since C is invertible, we also saw that if we have the standard format for x, or the standard coordinates for x, we can multiply that by C inverse. That will get us the coordinates for x with respect to the basis B. These two things, if you just multiply both sides of this equation-- let me do it in a different color-- if you just multiply both sides of this equation by C inverse on the left-hand side, you're going to get this equation right there. Now given that, let's see if we can find some type of relation. Let's see what D times xB is equal to. So let's say if we take D times xB, so this thing right here should be equal to D times the representation or the coordinates of x with respect to the basis B. That's what we're claiming. We're saying that this guy is equal to D times the representation of x with respect to the coordinates with respect to the basis B. Let me write all of this down. I'll do it right here, because I think it's nice to have this graphic up here. So we can say that D times xB is equal to this thing right here. It's the same thing as the transformation of x represented in coordinates with respect to B, or in these nonstandard coordinates. So it's equal to the transformation of x represented in this coordinate system, represented in coordinates with respect to B. We see that right there. But what is the transformation of x? That's the same thing as A times x. That's kind of the standard transformation if x was represented in standard coordinates. So this is equal to x in standard coordinates times the matrix A. Then that will get us to this dot in standard coordinates, but then we want to convert it to these nonstandard coordinates just like that. Now, if we have this, how can we just figure out what the vector Ax should look like? What this vector should look like? Well, we can look at this equation right here. We have this. This is the same thing as this. Actually. we want to go the other way. We have this. We have that right there. That's this right there. We want to get just this dot represented in regular standard coordinates. So what do we do? We multiply it by C. Let me write it this way. If we multiply both sides of this equation times C, what do we get? We get this right here. Actually, no. I was looking at the right equation the first time. We have this right here, which is the same-- first intuition is always right. We have this, which is the same thing as this right here. So this can be rewritten. This thing can be rewritten as C inverse-- we don't have an x here. We have an Ax here, so C inverse times Ax. The vector Ax represented in these nonstandard coordinates is the same thing as multiplying the inverse of our change of basis matrix times the vector Ax. If I have my vector Ax and I multiply it times the inverse of the change of basis matrix, I will then have a representation of the vector Ax in my nonstandard basis. Now, what is the vector x equal to? Well, the vector x is equal to our change of basis matrix times x represented in these nonstandard coordinates. So this is going to be equal to C inverse A times x. x is just the same thing as C. x is just C times our nonstandard coordinates for x, just like that. Let me summarize it, just because I waffled a little bit on this point right there just because I got a little bit confused. If I start off with the nonstandard representation of x, or x in coordinates with respect to B, I multiply them times D. So if I start with this, I multiply them times D, I get to that point right there. So this right there is the same thing as this point right there. That point right there should be the nonstandard representation of the transformation of x, or the coordinates of the transformation of x with respect to B. Now, the transformation of x, if x is in standard coordinates, is just A times x. So this is just A times x. But I want to represent it in these nonstandard coordinates. Now, A times x in nonstandard coordinates is the same thing as C inverse times A times x, if you think this is the same thing as this. So if you have this and you want to represent it in nonstandard coordinates, you multiply it by C inverse, so then you'll get that representation in nonstandard coordinates. Then finally, we say look, x is the same thing as C times the nonstandard coordinate representation of x. So we can replace x with that right there. So the big takeaway here is that D times the coordinates of x with respect to the basis B is equal to C inverse A times C times the coordinates of x with respect to the basis B. So D must be equal to C inverse AC. So if D is the transformation matrix for T with respect to the basis B-- and let me write here-- and C is the change of basis matrix for B-- let me write that down, might as well because this is our big takeaway-- and A is the transformation-- I'll write it in shorthand-- matrix for T with respect to the standard basis, then we can say-- this is the big takeaway-- that D, our matrix D, is equal to C inverse times A times C. That's our big takeaway from this video, which is really interesting. I don't want you to lose this point. We now understand that A is just for a certain set of coordinates. But there's arbitrary different bases that we can use to represent Rn, so we can have different matrices that represent the linear transformation under different coordinate systems. If we want to figure out those different matrices for different coordinate systems, we can essentially just construct the change of basis matrix for the coordinate system we care about, and then generate our new transformation matrix with respect to the new basis by just applying this result.