In geometry, the Peano curve is the first example of a space-filling curve to be discovered, by Giuseppe Peano in 1890.[1] Peano's curve is a surjective, continuous function from the unit interval onto the unit square, however it is not injective. Peano was motivated by an earlier result of Georg Cantor that these two sets have the same cardinality. Because of this example, some authors use the phrase "Peano curve" to refer more generally to any space-filling curve.[2]
Peano's curve may be constructed by a sequence of steps, where the
i
Si
Pi
S0
P0
In step
i
s
Si-1
c
Among these four orderings, the one for
s
Pi
c
c
The Peano curve itself is the limit of the curves through the sequences of square centers, as
i
The Peano curve shown in the introduction can be constructed using a Lindenmayer system. This L-system can be described as follows:
Variables: | ||
Constants: | ||
Start: | ||
Rules: | , |
where "" means "draw forward", "+" means "turn clockwise 90°", and "-" means "turn anticlockwise 90°". The image in the introduction shows the images of the first three iterations of the rules.
The curve shown in the 'construction' section be constructed as follows:
Variables: | ||
Constants: | ||
Start: | ||
Rules: |
where "" means "draw forward", "+" means "turn clockwise 90°", and "-" means "turn anticlockwise 90°". The image above shows the first two iterations of the rule.
In the definition of the Peano curve, it is possible to perform some or all of the steps by making the centers of each row of three squares be contiguous, rather than the centers of each column of squares. These choices lead to many different variants of the Peano curve.[3]
A "multiple radix" variant of this curve with different numbers of subdivisions in different directions can be used to fill rectangles of arbitrary shapes.
The Hilbert curve is a simpler variant of the same idea, based on subdividing squares into four equal smaller squares instead of into nine equal smaller squares.