The Peano Curve
A line that fills an entire square. In 1890 it shook mathematics. Today it's in your GPS data.
Discover the curve βA curve everywhere, invisible
Before understanding what it is, here's where you encounter it every day without knowing.
Geographic databases
PostGIS, Google Maps and every modern GIS use the Hilbert curve to index spatial coordinates. Points close on the map stay close in the disk index: spatial queries become 10β100Γ faster.
Fractal antennas in phones
Your smartphone's antenna is almost certainly fractal. Folding a space-filling curve compresses an enormous electrical length into a few centimetres β allowing Wi-Fi, 4G and 5G reception with a single tiny antenna.
CPU cache & memory
Memory access algorithms based on Hilbert curves improve cache locality in processors. 2D matrix operations (multiplications, image transforms) can be 2β4Γ faster.
Genomics & bioinformatics
Tools like Kraken2 use Hilbert curves to compress and index genetic sequences. The same idea allows visualizing entire genomes on screen while preserving local structure.
Rendering & image compression
Some GPUs scan pixels following a Hilbert curve instead of row-by-row: reduces cache misses in texture samplers. The same principle is used in some video codec compression algorithms.
Spatial hashing & cryptography
The "Morton code" (Z-order variant of the Peano curve) is used in data structures like 3D octrees and in some cryptographic algorithms for efficient bit shuffling.
The scandal of 1890
Mathematics had a precise idea of what a "curve" was. Then Peano arrived.
1878 β Cantor
The impossible bijection
Georg Cantor proved there is a bijection between the points of a line segment [0,1] and a square [0,1]Β². The result was so shocking he wrote to his colleague Dedekind: "Je le vois, mais je ne le crois pas" (I see it, but I don't believe it). The problem: Cantor's correspondence was discontinuous β a quantum jump, not a curve.
1890 β Peano
The curve without pictures
Giuseppe Peano, a mathematician from Spinetta (Cuneo, Italy), published "Sur une courbe, qui remplit toute une aire plane". A continuous function from [0,1] to [0,1]Β² that passes through every point of the square. The revolutionary detail: Peano included not a single drawing. He wanted the analytical proof to speak for itself, without misleading geometric intuition.
1891 β Hilbert
The visual variant
David Hilbert found Peano's construction hard to visualize and published his own variant with the famous U-shaped figures. The "Hilbert curve" is technically different from Peano's original (uses quaternary subdivision instead of ternary), but became the visual icon of the concept. Irony: Peano had deliberately avoided drawings, and Hilbert made it all comprehensible precisely with drawings.
1890β1920 β The crisis
Mathematics rethinks itself
The Peano curve threw fundamental definitions into crisis. What does "dimension" mean? What distinguishes a line from an area? Felix Klein, Henri PoincarΓ© and others had to rewrite topology from scratch. The need emerged to rigorously define concepts that seemed obvious: curve, surface, dimension. Modern topology was born.
Curiosity
Peano, the universal linguist
Giuseppe Peano was not only a mathematician: he also created "Latino sine flexione" (later called Interlingua), an artificial language simplified from Latin that he hoped would become an international lingua franca. He believed universal mathematical communication also required a universal language. In 1908 he gave his inaugural lecture at the University of Turin entirely in Latino sine flexione.
Build the Hilbert curve
At each iteration, every segment is replaced by a scaled version of the entire curve. Watch how the curve densifies until it "covers" the square.
π’ Start π End β The path color goes from red (start) to violet (end).
8Γ8
grid cells
64
cells visited
63
segments
π‘ At order 6, the curve passes through 4,096 cells of a 64Γ64 grid. At the theoretical limit (infinite order) it would pass through infinitely many points β every point of the square exactly once, with absolute continuity.
The property worth billions
The secret of the database application: move the slider on the 1D line and watch where nearby points fall in the 2D square.
Move the slider along the 1D line: nearby points (purple) appear clustered in the 2D square. "Locality" measures how grouped the cells are. This property makes the Hilbert curve useful in geographic databases.
β¦ This is called "locality preservation". It's why PostGIS can find all restaurants within 2 km of you in milliseconds instead of minutes.
The mathematics, at last
Formal definition
A Peano curve (or space-filling curve) is a continuous surjective function f: [0,1] β [0,1]Β². "Continuous" means no jumps. "Surjective" means every point of the square is visited at least once.
f: [0,1] β [0,1]Β² continuous & surjective
Note: it cannot be injective (crossing itself is unavoidable).
The length paradox
At each iteration n, the length of the Hilbert curve is (4/3)βΏ Γ initial size. In the limit nββ the length is infinite, yet the curve is confined to the unit square.
Lβ = (4/3)βΏ β β as n β β
Infinite length in finite area: one of the fundamental "paradoxes" of modern mathematics.
Fractal dimension = 2
The Hausdorff dimension of the Hilbert curve at the infinite limit is 2, not 1. It's a curve (1D parameterization) with "enough density" to occupy all 2D space. This is the precise sense in which it "fills" the square.
dim_H(Hilbert curve) = 2
Compare with Koch snowflake: dim_H = log4/log3 β 1.26. The Hilbert curve is even "denser".
Challenge your understanding
Who published the first space-filling curve, and in what year?