# Multiplying Matrices in your Head

Published 2020-07-12 13:14:14.51187 UTC

Back when I was leaning how to multiply matrices, I struggled to memorise any formulas or methods to do it because I didn't quite understand what was happening. In the end, I found a way to visualise it in my mind, and using that I became quite good at mentally multiplying two matrices together (as well as recognising if two matrices could be multiplied in the first place). The only problem was that it was a 3-dimentional visualisation, so I had no way to easily communicate how it worked.

This tool below shows what is happening in my mind when I do matrix multiplication (or a "dot product" since they're functionally identical). I hope that by visualising it like this, I can help others more easily understand matrix multiplication

Here's a step-by-step explanation of what's happening in the visualisation below:

### Step 1

Begin with the matrices side-by-side, as you would denote them for a matrix multiplication.

### Step 2

Position the second matrix so that the top edge of the first matrix and the left edge of the second matrix are adjacent, and the two matrices are perpendicular.

### Step 3

Between the two matrices there is a space for a 3D grid of numbers, wherein each number has a corresponding value in each of the given matrices. Fill this grid in by multiplying together those numbers for each grid position.

### Step 4

At the edge of the 3D grid to the right of the first matrix, make a new matrix wherein every "cell" is the sum of the row of numbers behind it. This final matrix is the result.

If you're using this method in your head, keep in mind that the central 3D grid can be calculated in any order; so it helps to solve each row (and thereby each value in the final matrix) one at a time.

### The Tool

Customise these two matrices, and then click "Step 1 (reset)" to see them below! Then click each step as they become available to watch this method in action.

Matrix 1 Height

Matrix 1 Width / Matrix 2 Height

Matrix 2 Width

Matrix 1

Matrix 2

Camera Controls

I hope this helps! You can find a permanent archived version of this tool on this linked page