Hilbert Curve

A space-filling curve of the given order. Rotation turns the square; the path always visits every cell once.

Hilbert Curve: A space-filling curve of the given order. Rotation turns the square; the path always visits every cell once.Hilbert Curve: A space-filling curve of the given order. Rotation turns the square; the path always visits every cell once.

About this pattern

David Hilbert, 1891

Hilbert Curve, fractal, drawn by GART: A space-filling curve of the given order. Rotation turns the square; the path always visits every cell once.
Hilbert Curve · CC BY 4.0

A space-filling curve: a 1D index folded until it visits every cell of a 2ⁿ×2ⁿ grid. Order is how many times the U is folded; rotation turns the square. The path is always a single stroke.

1D fold
The same index, first as a line, then folded into the plane. Order 2 visits every cell of a 4×4.

Behind the mathematics

David Hilbert1862–1943

Space-filling curve

German mathematician whose work transformed geometry and analysis; the space-filling curve bearing his name maps a line through a plane recursively.