The Gosper curve, also known as Peano-Gosper Curve, named after Bill Gosper, also known as the flowsnake (a spoonerism of snowflake), is a space-filling curve. It is a fractal object similar in its construction to the dragon curve and the Hilbert curve.
The Gosper curve can be represented using an L-System with rules as follows:
In this case both A and B mean to move forward, + means to turn left 60 degrees and - means to turn right 60 degrees - using a "turtle"-style program such as Logo.
A Logo program to draw the Gosper curve using turtle graphics (online version):
The program can be invoked, for example, with rg 4 300
, or alternatively gl 4 300
.
The space filled by the curve is called the Gosper island. The first few iterations of it are shown below:
The Gosper Island can tile the plane. In fact, seven copies of the Gosper island can be joined together to form a shape that is similar, but scaled up by a factor of √7 in all dimensions. As can be seen from the diagram below, performing this operation with an intermediate iteration of the island leads to a scaled-up version of the next iteration. Repeating this process indefinitely produces a tessellation of the plane. The curve itself can likewise be extended to an infinite curve filling the whole plane.