Skip to main content
GanitML

Matrices as transformations

See a matrix as a machine that moves every point of the plane, learn why its columns say where the axes land, and build one layer of a neural network.

FreeAbout 15 min

Step 1 of 8

A matrix moves the whole plane

In the last lesson, a vector was a point or an arrow. A matrix is a machine that moves points: put a vector in, get a new vector out. Do that to every point of the plane at once and the whole plane turns, stretches, slants or flattens.

An m×nm \times n matrix A∈Rm×n\mathbf{A} \in \mathbb{R}^{m \times n} is a grid of real numbers with mm rows and nn columns. The entry in row ii and column jj is aija_{ij}. A 2×22 \times 2 matrix is written

A=(a11a12a21a22)\mathbf{A} = \begin{pmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{pmatrix}

Press the presets and watch the grid, the arrows ı^\hat{\imath} and ȷ^\hat{\jmath}, and the letter F. Each preset is a different 2×22 \times 2 matrix acting on the plane.

Notice what never happens: grid lines never bend, and the origin never moves. That's the mark of the transformations matrices make.