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

Visualizing matrices

​Learn about a useful interpretation of matrices that helps to understand matrix multiplication and determinants.
In the last article we covered matrix fundamentals, but matrices are much more than tables of numbers. That's why in this article we'll discuss a way to think about matrices visually. This perspective makes a lot of what initially seems difficult about matrices become intuitive to understand. We'll only need this perspective for square matrices in multivariable calculus, so we will limit ourselves to those here.

Matrices as movement

What is the action of a matrix? What does a matrix look like? These questions may seem nonsensical, but we will answer them both by visualizing how 2×2 matrices move the 2D plane.
Here is a drawing of the plane, along with the unit vectors ı^ and ȷ^, which stand for (1,0) and (0,1).
Let's consider matrix A:
A=[1011]
This is how the matrix acts upon the grid:
  • The columns of the matrix tell us where it moves the unit vectors ı^ and ȷ^, which again stand for (1,0) and (0,1).
  • The rest of the grid follows accordingly, always keeping grid lines parallel and evenly spaced. The origin stays frozen in place.
That means A moves ı^(1,1) and ȷ^(0,1). Here's what that looks like:
The unit vector ȷ^ didn't move because it started at (0,1). The unit vector ı^ moved upward one unit, and this dragged the grid with it. Notice that there's a faint copy of the original lines in the background to help us stay oriented.
Let's see the same process for another matrix.
B=[0121]
We know B moves ı^(0,2) and ȷ^(1,1). That looks like this:
Here's a question to practice.
Problem 1
Suppose we have a matrix C=[2111].
What does the grid look like after we apply C?
Choose 1 answer:

To sum up, the action of a matrix is to move the entire grid. We can understand it by thinking about how it moves the unit vectors. We can visualize what this looks like by drawing a modified 2D grid.
These ideas extend into three dimensions as well. The third row of the matrix contains z-coordinates for all the unit vectors, and the third column of the matrix tells us where k^ lands.
If you'd like, play around with matrices as movement with this interactive demonstration. Drag the vectors to make the grid move, and see the matrix that corresponds to the movement in the top left corner.
To learn more about matrices as transformations, check out this article. For more practice, go here.

How matrices move vectors

We already know how a given matrix moves the unit vectors ı^ and ȷ^ (just look at the columns), but how can we find where a matrix moves any arbitrary vector? Let's consider a specific example using the first matrix from the previous section.
A=[1011]
How does A move the non-unit vector (1,2)? Before anything, let's get a feel for this visually. First, the vector with no matrix movement:
Now, the vector after the matrix moves the grid:
The vector just comes along for the ride as the matrix moves the grid, ultimately landing on (1,3). This is the essence of how matrices move vectors, which is formally called matrix-vector multiplication.
Now let's go over how we could calculate this. We represent (1,2) as a combination of the unit vectors by saying (1,2)=1ı^+2ȷ^.
This combination remains the same after we apply A, but instead of using ı^ and ȷ^, we use the result of applying A to ı^ and ȷ^:
Here's what the whole process looks like in symbols.
A[12]=A(1[10]+2[01])=A(1ı^+2ȷ^)=1Aı^+2Aȷ^=1[11]+2[01]=[13]
The critical step is when we break A(1ı^+2ȷ^) into 1Aı^+2Aȷ^. That is when we are able to represent where (1,2) lands in terms of where ı^ and ȷ^ land.
Let's try a couple practice questions.
Problem 2
Let B=[0211].
Where does B move the vector [31] in terms of where it moves ı^ and ȷ^?
Choose 1 answer:

Problem 3
Let B=[0211].
Where does B move the vector [31]?
B[31]=(
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
,
  • Your answer should be
  • an integer, like 6
  • a simplified proper fraction, like 3/5
  • a simplified improper fraction, like 7/4
  • a mixed number, like 1 3/4
  • an exact decimal, like 0.75
  • a multiple of pi, like 12 pi or 2/3 pi
)

Like in the section above, the idea behind matrices moving vectors extends into three dimensions. We just decompose our vector into a sum of ı^, ȷ^, and k^, then we use where the matrix takes all these unit vectors to find where it takes our vector.
Here's another interactive demonstration to play around with matrices moving vectors.
To learn more about matrix-vector multiplication, check out this video. To go deeper, try these videos from linear algebra.

Matrix multiplication intuition (optional)

With the perspective of matrices as movement, we have the tools to understand what it means to multiply two matrices. The core idea is composition.
A=[1101]B=[0110]
The product AB just means apply B, then apply A. When we apply A second, we treat the transformed ı^ and ȷ^ as regular vectors getting moved by A the way we learned in the previous section.
Created with this demonstration. Play around if you are interested!
To calculate the end result, we follow ı^ and ȷ^ along the two movements. First, B takes ı^(0,1) and ȷ^(1,0). Second, we find where A takes these vectors:
[1101][01]=[11][1101][10]=[10]
Putting these in a matrix, we have the product. Notice that our calculations are reflected in the visual above.
[1101][0110]=[1110]
To conclude, we can think of matrix multiplication as composing the movements each matrix represents. When we follow unit vectors along these movements, we can calculate the product.
As a challenge problem, try to derive the general formula for 2×2 matrix multiplication. Hint: follow ı^ and ȷ^ as B moves them, then follow where A moves the already transformed vectors.
As a bonus challenge problem, try to find the formula for multiplying 3×3 matrices. Hint: follow ı^, ȷ^, and k^.
To learn more about matrix multiplication, check out this video. For practice, try this exercise.

What's next

Now that we have a solid grasp of how matrices move space, we are in a prime position to understand the final concept that we'll cover in this review series: the determinant.

Want to join the conversation?

  • aqualine seedling style avatar for user Joseph Zullo
    does the explanation for a general formula of 2x2 matrix multiplication skip steps of exzplanation?

    for example,

    "first we follow i-hat."
    ---> [1,0], sure

    "the rightmost matrix moves it to (e,g)"
    ---> i agree that [e,g] moves [1,0] to [e,g]

    "when the left matrix moves (e,g), we can think of it as moving the combination of e[1,0] + g[0,1]
    ---> why can we think of it like that? where did [0,1] come from? why does it look like j-hat is now in the picture when we agreed to only follow i-hat?
    (5 votes)
    Default Khan Academy avatar avatar for user
    • leaf green style avatar for user Laker
      That's a good question, Joseph. The reason [0, 1] comes into play is that the left matrix is now moving an entire vector, (e, g). The way matrix vector multiplication works is detailed in the section "How matrices move vectors." I hope this helps!
      (2 votes)
  • hopper jumping style avatar for user Timothy
    I am the only one who breezed through everything (I already did calc II with vectors last semester)...until I got to matrices, and then I was like oh drat I learned this at one point...or is it just me...

    That matrix notation is weird, the [3 onTopOf 2] etc

    For my question, what on earth is going on in the last example? The Matrix multiplication intution?

    Pretty lonely over here...
    (3 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user s.muttath.d
    Hi This is very good explanation. My question for section "How matrices move vectors" :
    I understand the matrix A also moves co-ordinate i and j to new values. Say i2 and j2.
    When A moves v1 = (1, 2) to v2 = (1, 3), the 1 and 3 are with respect to original co-ordinate i and j. With respect new co-ordinate i2 and j2 the value of v2 is still (1,2). Right?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user eddie.cjd
    There is a typo:

    Here's what the whole process looks like in symbols.

    The first blue vector
    [
    1
    0
    ​]

    should be

    [
    1
    1
    ]
    (1 vote)
    Default Khan Academy avatar avatar for user