Matrix multiplication in this visualization
A 2 × 2 matrix is a linear map of the plane, and its columns are where it sends and . The product is the matrix of doing two maps in a row, first and then : for every vector . The matrix next to acts first, so a product is read from right to left.
In the order , the left picture shows on the standard grid: and as faint dashed arrows, and their images and , the columns of , in blue. The right picture shows : the grid it makes of the standard grid, its columns and in ink, and the columns of the product, and , in blue. The flag shows the same two steps on a shape. Each picture has its own scale, because a product can reach far beyond its factors.
Where does a column of come from? sends to , which is steps of and steps of . is linear, so it sends that point to the same steps of its own columns: of followed by of . It only reads the two numbers of , not how was made. On the right the selected product column is drawn as this recipe, two thin legs along and that end at the blue arrow. Drag on the left and the legs stretch and shrink with its numbers.
The rule taught as row times column is this recipe written in coordinates. The x-coordinate of adds up the horizontal parts of its two legs, : row 1 of against column of . The y-coordinate comes from row 2 in the same way. Row × column draws these parts along the axes, each labelled with its product.
Order matters because the second map works on what the first one produced. Turn by a quarter and then shear: goes to and then to . Shear first and then turn: stays at and then goes to . Once the other order has been composed too, its result appears on the right as dashed blue arrows, until A or B changes. Some pairs do commute. Two turns of the plane about the origin add their angles in either order.
Area factors multiply. turns the unit square into a parallelogram of area , and then multiplies every area by . With signs, , and because numbers commute, even when . In the default, and , so both products have determinant 6.
Things to notice
- In the order , Compose moves to along a straight line. The path only shows where ends up, not how moves the plane.
- A negative area factor is not a negative area. It says that the map flips the plane over, and areas are multiplied by its absolute value.
Controls
- In the order , pointing at on the left marks on the right with a small cyan ring.
Related
- Linear combinationPlanned
- BasisPlanned
- Linear transformation
- DeterminantPlanned
- EigenvectorPlanned
- Rigid transformation
Further reading: Wikipedia: Matrix multiplication; OpenStax, College Algebra 2e, 7.5 Matrices and Matrix Operations.