Peano Curve
Divide a square into nine smaller squares and visit them in an S: along the bottom row, back along the middle row, along the top row. Then replace each small square's straight stretch with a copy of the same S, mirrored so its end meets the start of the next copy, and repeat.
This is a way to draw, with a pen, what Giuseppe Peano showed in 1890: a single unbroken line can pass through every point of a square, even though a line has no width. His paper has no picture and defines the curve with base-3 digits.1
Every round multiplies the number of lines by nine and divides their length by three, so the route gets three times longer each round and every point of the square ends up closer to it. In the limit, the route passes through all of them, and sliding along the line below shows where each position lands.
Slide along the line. The dot shows where that position lands on the finished curve.
Now press Visited twice, and two different places on the line land on one dot. Visited four times finds a dot reached from four places. Peano noted the same counts in 1890: two or four.1
The curve can't avoid this, because a continuous line that covers a whole square must pass through some points more than once.2 So the finished curve touches itself at these points, even though the drawing at every round looks like a route that never crosses.
The Hilbert curve fills a square too, and Hilbert published it a year after Peano, with drawings.3 It divides into four squares each round and rotates its copies, while Peano's divides into nine and mirrors them.
Further exploring
Videos
Reading
Sources and notes
- Sur une courbe, qui remplit toute une aire plane, in French: base-3 digits on p. 157, two or four positions on p. 160.
- A Space-Filling Curve, p. 1, on Netto's theorem.
- Ueber die stetige Abbildung einer Linie auf ein Flächenstück, in German.