Report Tool or Give Us Suggestions

Gosper Curve Generator

Generate and visualize the beautiful space-filling Gosper curve fractal with custom iterations and styling.

L ading . . .

Understanding the Gosper Curve: The Fascinating Space-Filling Flowsnake Fractal

The Gosper Curve, also known as the Flowsnake, is a continuous, space-filling curve first discovered by the American mathematician and computer scientist Bill Gosper in 1973. It is a beautiful example of a self-similar fractal constructed recursively using a formal L-System (Lindenmayer System).

How the Gosper Curve Works

Like other space-filling curves (such as the Hilbert curve or the Peano curve), the Gosper curve is defined as the limit of a sequence of piecewise linear curves. As the number of iterations approaches infinity, the curve completely "fills" a 2D fractal region called the Gosper Island.

The construction of the Gosper curve is described by a 2-character L-System using a turning angle of $60^\circ$ (or $\frac{\pi}{3}$ radians). The system utilizes two drawing characters, $F$ and $G$, both representing "draw forward by one unit step".

L-System Formalism:
Axiom (Start): F
Angle: 60°
Rules:
  F = F - G - - G + F + + F F + G -
  G = + F - G G - - G - F + + F + G
(Where '+' means turn right by 60° and '-' means turn left by 60°.)

Properties of the Gosper Island

When the Gosper curve is drawn, the boundary of the region it fills is a highly complex fractal curve of its own. This boundary is called the Gosper Island.

  • Fractal Dimension: The boundary of the Gosper island has a Hausdorff dimension of: $$D = \frac{\ln 3}{\ln \sqrt{7}} \approx 1.12915$$ This means that the boundary is slightly more complex than a standard 1D line but does not fill 2D space.
  • Plane Tiling: An extraordinary property of the Gosper Island is that copies of it can tile the entire 2D plane perfectly without overlapping, similar to how hexagons tile a honeycomb.
  • Spatial Continuity: Like other space-filling curves, it maps a 1D sequence of points continuously to a 2D plane. It is often used in indexing spatial data due to its continuous flow and clustering properties.

Frequently Asked Questions

Frequently Asked Questions

Why is the Gosper curve called the "Flowsnake"?

The name "Flowsnake" is a playful spoonerism of "snowflake" (as in the Koch Snowflake) and "flow snake". Because of the $60^\circ$ angles and hexagonal structure, its recursive layers flow like a snake wrapping tightly inside a hexagonal grid.

How many segments are in a Gosper curve of iteration N?

Each iteration replaces each segment with 7 new segments. Therefore, the total number of segments at iteration $N$ is exactly $7^N$. For iteration 1, there are $7$ segments; for iteration 3, there are $343$ segments; and for iteration 5, there are $16,807$ segments.

Can copies of Gosper Islands tile the plane?

Yes! The Gosper Island is a "rep-tile" (replicating tile). Seven copies of a Gosper Island can be arranged to form a larger, perfectly interlocking Gosper Island, which allows infinite hexagonal tiling of the plane.

What are the practical uses of the Gosper curve?

It is used in digital image processing, color halftone dithering (to avoid linear patterns), and parallel computing where spatial load-balancing is crucial. Because it traverses coordinates hexagonally, it can represent grid systems better than simple rectangular scans.

logo OnlineMiniTools

OnlineMiniTools.com is your ultimate destination for a wide range of web-based tools, all available for free.

Feel free to reach out with any suggestions or improvements for any tool at admin@onlineminitools.com. We value your feedback and are continuously striving to enhance the tool's functionality.

© 2026 OnlineMiniTools . All rights reserved.

Hosted on Hostinger

v1.10.0