Fractal Curves Screensaver
Fractal Curves is a free, in-browser screensaver that traces six classic fractal curves from end to end: the Heighway dragon, the Lévy C curve, the Koch snowflake, the terdragon, the Gosper curve and the Koch island. Each is generated by rewriting a turtle string a dozen times and is a single line that never crosses itself, growing more crinkled with every rewrite. Nothing to download, and ESC exits at any time.
How the Fractal Curves screensaver works
Every curve is an L-system: a starting string and a rewrite rule. The dragon starts from FX with X → X+YF+ and Y → −FX−Y; the Koch snowflake from a triangle with F → F+F−−F+F at sixty degrees. Applying the rule n times gives the order-n curve, and a turtle walks the result.
The Heighway dragon is what a strip of paper does when folded in half n times and opened with every crease at a right angle — the rewrite is the fold. The Lévy C replaces each segment with two at forty-five degrees and builds a shape like a bishop’s mitre. The Koch snowflake adds a bump to every edge, and its perimeter grows without bound while its area stays finite.
The terdragon replaces each segment with three at 120 degrees and tiles the plane with copies of itself; the Gosper curve does the same on a hexagonal grid and is the outline of the flowsnake. Each curve is scaled to fit the screen before drawing.
The line is revealed at a steady rate with the hue advancing along it, so colour marks how far along the string the pen is, and a glowing head marks the pen. Finished curves hold, fade, and give way to the next.
Four curves from rewriting rules
These curves arose from different people and decades. The dragon curve was first investigated in 1966 by the NASA physicists John Heighway, Bruce Banks and William Harter, and Martin Gardner described it in his Scientific American column in 1967; it later appeared on the section title pages of Michael Crichton’s Jurassic Park. Helge von Koch introduced the Koch curve in 1904 as a continuous curve with no tangent at any point. The C curve is named for Paul Lévy, who described its self-similarity, and Bill Gosper gave his name to the Gosper curve, also called the flowsnake, a spoonerism on snowflake.
Each has a fractal dimension, a measure of how completely the curve fills space. The Koch curve’s dimension is ln 4 / ln 3, about 1.26, between a line and a plane. The dragon curve is space-filling, with dimension exactly 2, and copies of it can tile the plane; the Gosper island, the shape bounded by the Gosper curve’s boundary, also tiles the plane.
The same trick of replacing each piece with a scaled arrangement of smaller pieces underlies all of them, which is why they can be drawn by a short program. That fits the notion of L-systems, devised by the biologist Aristid Lindenmayer in 1968 to model the development of simple multicellular organisms and, later, plant growth.
A worked example
At the defaults — Cycle, Speed 4, Spectrum — the dragon draws itself as 8192 right-angled steps that fold into its familiar lobed silhouette, the colour revealing that the second half of the string is a rotated copy of the first. Then the snowflake closes its six-pointed outline, the Lévy C builds its mitre, and the Gosper curve fills a hexagon. Pick Heighway dragon alone and watch it repeat with a fresh hue each time.
Settings & tips
- Slow the speed to 1 to see the right-angle folds of the dragon one at a time.
- Mono in white on black makes clean line-art stills of each curve.
- The Koch island is the snowflake’s square cousin, with a perimeter that doubles each order.
Frequently asked questions
- Why is it called the dragon curve?
- NASA physicists John Heighway, Bruce Banks and William Harter found it in 1966 by folding paper and thought the shape looked like a dragon; Martin Gardner popularised it in Scientific American the following year.
- Does the Koch snowflake really have infinite perimeter?
- Yes. Each order multiplies the perimeter by four thirds, so it grows without bound, while the enclosed area converges to eight fifths of the original triangle. It was Helge von Koch’s 1904 example of a curve with no tangent anywhere.
- Will this slow my computer down?
- It is tuned to run smoothly on an ordinary laptop. If it feels heavy, raise the Pixel size or lower the speed in the settings; every control takes effect immediately.
- Is the Fractal Curves screensaver free?
- Yes. It runs free in your browser with nothing to download or install, and it keeps working offline once the page has loaded.
- How do I exit the Fractal Curves screensaver?
- Press the ESC key at any time to leave fullscreen and return to the page.
- Do dragon curves tile the plane?
- Yes. Copies of the dragon curve can tile the plane, for example by replacing each edge of a square tiling with a dragon curve.
- Why is the Gosper curve called the flowsnake?
- The name is a spoonerism of snowflake, a nod to the Koch snowflake. Seven copies of the Gosper island fit together into a larger similar shape, scaled by the square root of seven.
- Who invented L-systems?
- The Hungarian-born biologist Aristid Lindenmayer introduced them in 1968 to model how simple multicellular organisms develop. They later became standard in fractal drawing.