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.

## Algebra (all content)

### Course: Algebra (all content)>Unit 20

Lesson 10: Matrices as transformations

# Matrices as transformations

Learn how exactly 2x2 matrices act as transformations of the plane.

## Introduction

If we think about a matrix as a transformation of space it can lead to a deeper understanding of matrix operations. This viewpoint helps motivate how we define matrix operations like multiplication, and, it gives us a nice excuse to draw pretty pictures. This material touches on linear algebra (usually a college topic).

## Multiplication as a transformation

The idea of a "transformation" can seem more complicated than it really is at first, so before diving into how $2×2$ matrices transform $2$-dimensional space, or how $3×3$ matrices transform $3$-dimensional space, let's go over how plain old numbers (a.k.a. $1×1$ matrices) can be considered transformations of $1$-dimensional space.
"$1$-dimensional space" is simply the number line.
What happens when you multiply every number on the line by a particular value, like $2$? One way to visualize this is as follows:
We keep a copy of the original line for reference, then slide each number on the line to $2$ times that number.
Similarly, multiplication by $\frac{1}{2}$ could be visualized like this:
And so that negative numbers don't feel neglected, here is multiplication by $-3$:
For those of you fond of fancy terminology, these animated actions could be described as "Linear transformations of $1$-dimensional space". The word “transformation” means the same thing as “function”: something which takes in a number and outputs a number, like $f\left(x\right)=2x$. However, while we typically visualize functions with their graphs, people tend to use the word “transformation” to indicate that you should instead visualize some object moving, stretching, squishing, etc. So the function $f\left(x\right)=2x$ visualized as a transformation gives us the "Multiplication by $2$" video above. It moves the point $1$ on the number line to where $2$ starts off, moves $2$ to where $4$ starts off, etc.
Before we move on to $2$-dimensional space, there's one simple but important fact we should keep in the back of our minds. Suppose you watch one of these transformations, knowing that it's multiplication by some number, but without knowing what that number is, like this one:
You can easily figure out which number is being multiplied into the line by . In this case, $1$ lands where $-3$ started off, so you can tell that the animation represents multiplication by $-3$.

## What do linear transformations in $2$‍  dimensions look like?

A $2$-dimensional linear transformation is a special kind of function which takes in a $2$-dimensional vector $\left[\begin{array}{c}x\\ y\end{array}\right]$ and outputs another $2$-dimensional vector. As before, our use of the word “transformation” indicates we should think about smooshing something around, which in this case is $2$-dimensional space. Here are some examples:
For our purposes, what makes a transformation linear is the following geometric rule: The origin must remain fixed, and all lines must remain lines. So all the transforms in the above animation are examples, but the following are not:

## Following specific vectors during a transformation

Imagine you are watching one particular transformation, like this one
How could you describe this to a friend who is not watching the same animation? You can no longer describe it using a single number, the way we could just follow the number $1$ in the one dimensional case. To help keep track of everything, let's put a green arrow over the vector $\left[\begin{array}{c}1\\ 0\end{array}\right]$, put a red arrow over the vector $\left[\begin{array}{c}0\\ 1\end{array}\right]$, and fix a copy of the grid in the background.
Now it's a lot easier to see where things land. For example, watch the animation again, and focus on the vector $\left[\begin{array}{c}1\\ 1\end{array}\right]$, we can more easily follow it to see that it lands on the vector $\left[\begin{array}{c}4\\ -2\end{array}\right]$.
We can represent this fact with the following notation:
$\left[\begin{array}{c}1\\ 1\end{array}\right]\to \left[\begin{array}{c}4\\ -2\end{array}\right]$
Practice Problem: Where does the point at $\left[\begin{array}{c}-1\\ 0\end{array}\right]$ end up after the plane has undergone the transformation in the above video?

Practice Problem Even though it has gone off screen, can you predict where the point $\left[\begin{array}{c}3\\ 0\end{array}\right]$ has landed?

Notice, a vector like $\left[\begin{array}{c}2\\ 0\end{array}\right]$, which starts off as $2$ times the green arrow, continues to be $2$ times the green arrow after the transformation. Since the green arrow lands on $\left[\begin{array}{c}1\\ -2\end{array}\right]$, we can deduce that
$\left[\begin{array}{c}2\\ 0\end{array}\right]\to 2\cdot \left[\begin{array}{c}1\\ -2\end{array}\right]=\left[\begin{array}{c}2\\ -4\end{array}\right]$.
And in general
$\begin{array}{rl}\left[\begin{array}{c}x\\ 0\end{array}\right]=x\cdot \left[\begin{array}{c}1\\ 0\end{array}\right]& \to x\cdot \left[\begin{array}{c}1\\ -2\end{array}\right]=\left[\begin{array}{c}x\\ -2x\end{array}\right]\end{array}$
Similarly, the destination of the entire $y$-axis is determined by where the red arrow $\left[\begin{array}{c}0\\ 1\end{array}\right]$ lands, which for this transformation is $\left[\begin{array}{c}3\\ 0\end{array}\right]$.
Practice Problem: After the plane has undergone the transformation illustrated above, where does the general point $\left[\begin{array}{c}0\\ y\end{array}\right]$ on the $y$-axis land?

In fact, once we know where $\left[\begin{array}{c}1\\ 0\end{array}\right]$ and $\left[\begin{array}{c}0\\ 1\end{array}\right]$ land, we can deduce where every point on the plane must go. For example, let's follow the point $\left[\begin{array}{c}-1\\ 2\end{array}\right]$ in our animation:
It starts at $-1$ times the green arrow plus $2$ times the red arrow, but it also ends at $-1$ times the green arrow plus $2$ times the red arrow, which after the transformation means
$-1\cdot \left[\begin{array}{c}1\\ -2\end{array}\right]+2\cdot \left[\begin{array}{c}3\\ 0\end{array}\right]=\left[\begin{array}{c}5\\ 2\end{array}\right]$
This ability to break up a vector in terms of its components both before and after the transformation is what's so special about linear transformations.
Practice Problem: Use this same tactic to compute where the vector $\left[\begin{array}{c}1\\ -1\end{array}\right]$ lands.

## Representing two dimensional linear transforms with matrices

In general, since each vector $\left[\begin{array}{c}x\\ y\end{array}\right]$ can be broken down as
$\left[\begin{array}{c}x\\ y\end{array}\right]=x\left[\begin{array}{c}1\\ 0\end{array}\right]+y\left[\begin{array}{c}0\\ 1\end{array}\right]$
If the green arrow $\left[\begin{array}{c}1\\ 0\end{array}\right]$ lands on some vector $\left[\begin{array}{c}a\\ c\end{array}\right]$, and the red arrow $\left[\begin{array}{c}0\\ 1\end{array}\right]$ lands on some vector $\left[\begin{array}{c}b\\ d\end{array}\right]$, then the vector $\left[\begin{array}{c}x\\ y\end{array}\right]$ must land on
$x\cdot \left[\begin{array}{c}a\\ c\end{array}\right]+y\cdot \left[\begin{array}{c}b\\ d\end{array}\right]=\left[\begin{array}{c}ax+by\\ cx+dy\end{array}\right]$
A really nice way to describe all this is to represent a given linear transform with the matrix
$\mathbf{\text{A}}=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$
where the first column tells us where $\left[\begin{array}{c}1\\ 0\end{array}\right]$ lands and the second column tells us where $\left[\begin{array}{c}0\\ 1\end{array}\right]$ lands. Now we can describe where any vector $\mathbf{\text{v}}=\left[\begin{array}{c}x\\ y\end{array}\right]$ lands very compactly as the matrix-vector product
$\mathbf{\text{Av}}=\left[\begin{array}{c}ax+by\\ cx+dy\end{array}\right]$
In fact, this is where the definition of a matrix-vector product comes from.
So in the same way that $1$-dimensional linear transforms could be described as multiplication by some number, namely whichever number $1$ lands on top of, $2$-dimensional linear transforms can always be described by a $2×2$ matrix, namely the one whose first column indicates where $\left[\begin{array}{c}1\\ 0\end{array}\right]$ lands, and whose second column indicates where $\left[\begin{array}{c}0\\ 1\end{array}\right]$ lands.

## Want to join the conversation?

• The specific 2d linear transformation with background goes by a little fast. Can you slow it down so I can follow what is going on?
• You can go frame by frame on youtube videos by pressing period (.) to go to the next frame and comma (,) to go to the previous frame. All this with video paused.
• "Practice Problem: Even though it has gone off screen, can you predict where the point 3,0 has landed?"

No. No, I can't. Even if it was all on-screen, it moves so fast. Yes, (1,1) goes to (4,-2), but I can only see this because there's a grid underneath the overlay of the transformation.

I see nowhere on Khan where it's explained how to just "know" what the transformation is or how to calculate it backwards without having coordinates. Okay, set the video to slow-motion and pause it, and decipher the coordinates.. Good. Now, how do we know what the transformation is?

I aced matrices up until the last problem set of this section, where you aren't given data for a transformation. Almost zero instruction on a topic hugely removed from the rest of mathematics.
• You need to look at the now transformed grid lines. It's actually super easy if you look at the vectors <1,0> and <0,1> specifically.

<1,0> shifts to <1, -2> so now any x component in a vector gets transformed so it is however long it was multiplied by <1, -2> so for instance <1, 0> goes to <1, -2>, <2,0> would go to <2, -4> and so on.

This is only the x component though, so we want to look at y as well. y goes from <0, 1> to <3,0> so <0, 2> would go to <6,0> and so on.

Now, we can put them all together, let's use the one in particular it asks for.

<3,0> only has an x component so it's actually easy. I will showhow to do this with <1,1> after. but <3,0> goes to 3*<1, -2> = <3, -6>.

Since you can see <1,1> it should be easy to see. Anyway, if we pretended we couldn't see <1,1> we would just multiply each component by its transformation. so 1*<1, -2> + 1*<3, 0> = <1, -2> + <3, 0> = <4, -2>

<2, 2> would be similar
2*<1, -2> + 2<3,0>
<2, -4> + <6,0>
<8, -4>

Let me know if this didn't help, to summarize though look at how <1,0> and <0,1> initially transform then you can solve for any other vector/ point.
• Why does the two vectors that when transform, can deduce where others go have to be (1 0) and
(0 1)? Why can't there be any ones?
• They don't. They just have to be two vectors that aren't parallel. But since we could use any pair of (non-parallel) vectors, it makes sense to use the two simplest vectors we can think of -- i.e., (1 0)) and (0 1).
• Where do f(v+w)=f(v)+f(w) and f(cx)=cf(x) proprities come from ?
• Algebra. They are the distributive property.
• If the reality is all about transformations, why do they teach us normal algebra like a set of rules?

At least for me, visualization helps to understand concepts quickly.I was always curious to know why different graphs have different curves.I guess 'transformation of points' is the answer to that.
• Reality is we do math not because it gives us a lot of knowledge. But, it's actually the easiest language your brain can understand. It's like the code for a computer.
But, today world is creating new stuff which could be done using math stuff. Our brain is very curious. That's why we study math. You would never can experience the complex numbers in real life. But, why do we study them? Cause math sharpens brain. Think of it like a computer. If a computer can understand as many languages as possible, it's more efficient. Same with math, and math is big branch of subjects. And each subject can be referred as language. This is my theory and I love math. Probably, I'm the best lover of math!!
• For those of you who have a hard time with the idea of matrices as transformations, I suggest you try watching 3b1b's Essence of Linear Algebra series, it clears a lot of fundamental questions about matrix operations I often see in this site, such as why Identity matrices are such, why columns have to match rows for matrix multiplication and almost any question you can think of. (well, most of it, isomorphism is really difficult)
• Thank you so much! I was stuck with this article and started to watch 3b1b. It really helped.
• Perhaps linear algebra should not be a "wait-for-college" topic. Maybe it should be taught in conjunction with different coordinate systems much earlier. Do you know of anyone teaching along these lines?
• Why do we put practices before the explanation? That makes no sense.
• A complex number p = a + b∙i can be thought of as a vector in complex space p = [a b], and therefore a linear transformation by a 2x2 matrix T on the vector p would be

p * T = s

I show this sequence since originally I learned these complex vectors as row-oriented, and they are easier to conceptualize relative to rectangular and polar forms of complex numbers.

While I understand modifying the notation presented in this review involves trivial matrix transposition:

v = p'
A = T'
such that A * v = s'

I am curious if anyone else prefers to conceptualize linear transforms of 2-space vectors in the above way?