The matrix machine

A 2×2 matrix is a machine that moves every point of the plane. The grey grid and square are the input. The coloured grid, square and house are what comes out. Change the four numbers, or try the presets.

Presets

What's going on

The matrix with rows (a b) and (c d) sends the point (x, y) to (ax + by, cx + dy). The easiest way to see what it does: the first column (a, c) is where the point (1, 0) lands, and the second column (b, d) is where (0, 1) lands. Everything else follows, because the grid stays a grid of parallelograms. Straight lines stay straight and the origin never moves.

The number ad − bc is the determinant. Its absolute value is the area of the output unit square, so it tells you how much the machine scales areas. A negative determinant means the picture has been flipped over, like a reflection. A zero determinant squashes the whole plane onto a line, or onto a single point if all four entries are zero, and then there is no way back: that machine has no inverse.

Try Fibonacci, then imagine applying it again and again to the point (1, 0). The coordinates you get are consecutive Fibonacci numbers.

Sheet: Matrices: grids that do things.