Draw Twin Heighway Fractal

Draw the twin Heighway dragon (NASA 1966) - two dragons at 90° tile the plane. Dim 2.0. Free, offline, client-side, instant, secure.

Renders the twin Heighway dragon: two copies of the Heighway dragon sharing a common origin, the second rotated 90°. Each dragon is space-filling (dim = 2.0); together they form a topological tile of the plane. Discovered by Heighway, Banks, and Harter at NASA in 1966; popularised by Martin Gardner in Scientific American (March 1967).

How to Use Draw Twin Heighway Fractal

  1. Pick iterations (1-15). Each dragon has 2ᴺ segments: iter 10 = 1,024; iter 15 = 32,768 (so the twin has 65,536 in total).
  2. Pick segment length (1-20 px). The tool auto-scales to fit.
  3. Choose display mode: both dragons (the tile), dragon 1 only (heading 0°), or dragon 2 only (heading 90°). Use a single-dragon view to inspect the classic Heighway curve in isolation.
  4. Pick two colors. A toast warns if both dragons share a color too close to be distinguished.
  5. Optionally enable symmetry axes - draws the horizontal and vertical axes through the shared starting point (the rotation center).
  6. Click Draw Fractal or press Ctrl/Cmd + Enter. Iter 14+ shows a non-blocking time estimate.
  7. Copy or download the PNG. Filename encodes iteration.

Frequently Asked Questions

What is the twin Heighway dragon?

The Heighway dragon is a space-filling curve discovered by NASA physicists John Heighway, Bruce Banks, and William Harter in 1966, and brought to wide attention by Martin Gardner’s Mathematical Games column in Scientific American (March 1967). The twin dragon places two copies of the same curve at a common origin, the second rotated 90°. The pair forms a topological tile of the plane – when the curve is iterated to infinity, two copies fit together without gaps or overlaps and any number of those tiles cover the whole plane.

What is the L-system?

Both dragons share the same L-system: axiom F X, with rewrite rules X → X+YF+ and Y → -FX-Y, and turn angle 90°. F means “draw forward one unit”; + and − rotate the heading by 90°; X and Y are non-drawing recursion tokens. After N iterations the F-count in the string is exactly 2 to the N. An earlier version of the spec for this tool claimed “axiom FX and FY” for two separate L-systems – that was wrong; the code uses one L-system and just renders it twice with different initial headings (0° for dragon 1, 90° for dragon 2). The spec has been corrected.

What is the fractal dimension?

Exactly 2.0. The Heighway dragon’s image in the infinite-iteration limit is a closed plane region with positive area (no holes, no thin parts). The similarity dimension is log(2) divided by log(√2) = log(2) / (0.5 × log(2)) = 2. The displayed value in the stats line is this asymptotic value; at any finite iteration the polyline is still 1-dimensional in the strict sense.

Does the rendered figure actually tile the plane?

The tiling property holds in the limit, not at any finite iteration. At iter 10 you see a recognizable approximation; at iter 15 the outline is sharper but the figure is still made of straight unit segments and has visible “fringe”. An earlier version of this tool’s stats line appended “Tiles the plane perfectly” at iter ≥ 10 – that wording was misleading because the threshold is arbitrary and the property is asymptotic. The stats line now says “approaches tile attractor at infinity”.

How is this related to paper folding?

If you fold a strip of paper in half N times, always in the same direction, and then unfold it so each crease is a right angle, the strip traces the Heighway dragon at iteration N. This is the original physical motivation Heighway noticed at NASA Goddard. The 2 to the N segment count corresponds to the number of segments in the unfolded strip.

What’s the difference between dragon 1 and dragon 2?

Nothing – they are literally the same curve from the same L-system. The only difference is the initial heading of the turtle: dragon 1 starts heading 0° (rightward), dragon 2 starts heading 90° (upward). The 90° offset produces the perfect-tile configuration. You can confirm this by viewing one dragon at a time using the display mode dropdown – the shapes are identical, just rotated.

Why does iteration 15 take longer?

Iteration 15 generates 2 to the 15 = 32,768 segments per dragon, so 65,536 total for the twin. Each segment is a separate stroke operation. On a modern machine the render takes 2-4 seconds. For interactive exploration, iter 10-12 (1,024 to 4,096 segments per dragon) is plenty.

Is anything sent to a server?

No. The tool loads three static files (HTML, CSS, JS) and then runs entirely in your browser – L-system expansion, drawing, PNG export, clipboard copy. You can disconnect from the internet after the page loads. No analytics, no tracking, no cookies.

Is this tool free?

Yes – free, unlimited, no signup, no watermark. Use the PNGs in lectures, papers, blog posts, or art freely. Attribution to is appreciated but not required.