Eigensoul LabNo. 044 / 100Mathematics
Watch each order draw itself. Restart to begin again from the simplest curve.

Mathematics · Study 044

Hilbert Curve

Watch a Hilbert curve thread through every cell of a grid without lifting the pen, from order 2 up to order 7 and 16,384 cells.

What you're looking at

The curve of order n visits each cell of a 2 to the n by 2 to the n grid exactly once, moving only to adjacent cells. Each order is built from four copies of the previous one, two of them rotated, joined by three short links. The red dot is the pen.

The idea behind it

David Hilbert published the construction in 1891 to show that a continuous line can pass through every point of a square. It has a practical afterlife: because points close together on the curve are close together in the square, databases and image formats use it to map two dimensional data onto a one dimensional index.

Try this

Watch each order draw itself. Restart to begin again from the simplest curve.

  • hilbert curve
  • space-filling curve
  • fractal
  • recursion
  • spatial index