How It Works
The Hilbert curve is constructed recursively by bending a simple U-shaped motif into four smaller copies of itself, rotated and connected. After n recursions the path visits all 2^{2n}
points in a grid of size 2^n × 2^n
.
Properties
- Space-filling: eventually covers every point in a square.
- Locality preserving: points that are close in 1-D index remain close in 2-D, making it useful for image encoding and databases.
- Self-similar: each level is composed of four rotated copies of the previous level.
In the Gallery
- The curve is drawn segment by segment in colour order.
- After finishing the path the canvas clears and the dance begins anew.