# The Dragon Curve & Space-Filling Curves (Hilbert, Peano, Cantor)

> From a NASA physicist's paper-folding experiment to a curve that almost fills all of 2D space — meet the dragon curve and its kin: the curves that forced mathematicians to rethink what dimension even means.

*Published 2026-06-25 · Updated 2026-06-25 · By Dr. Elena Marchetti*

In 1966, a NASA physicist named John Heighway was passing time by repeatedly folding a strip of paper in half — always in the same direction. When he unfolded the strip and bent each crease to a right angle, the result was a coiling, asymmetric shape that looked nothing like what he expected from such a simple rule. He called it the **dragon curve**, and the name stuck.

What Heighway had stumbled upon was a fractal — a curve that becomes arbitrarily complex through an endlessly repeated operation, never self-intersecting yet approaching the task of filling two-dimensional space. It belongs to a remarkable family of objects: *space-filling curves*, mathematical constructions that force us to reconsider the very meaning of dimension.

This guide covers the dragon curve in depth, then surveys three of its most important relatives — the [Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve), the [Peano curve](https://en.wikipedia.org/wiki/Peano_curve), and the [Cantor set](https://en.wikipedia.org/wiki/Cantor_set) — each a landmark in the history of fractal geometry and each still finding new applications in science and computing today.

  Key Takeaway: Space-filling curves are continuous paths — technically one-dimensional objects — that, through infinite iteration, traverse every point in a two-dimensional region. They expose a deep truth: dimension is not as simple as counting spatial directions.

## What Is the Dragon Curve Fractal, and How Is It Constructed?

The **Heighway dragon** (also called the Harter–Heighway dragon, or informally the Jurassic Park fractal, after the spiral patterns that open Michael Crichton's 1990 novel) is a fractal plane curve generated by a beautifully simple recursive rule.

### Paper-Folding Construction

Take a long strip of paper. Fold it in half to the right. Fold it in half to the right again. Keep folding — always in the same direction. After *n* folds you have a strip with 2n − 1 creases. Now unfold it so that every crease forms a 90° angle. The resulting planar curve is the *n*th iteration of the Heighway dragon.

After the first fold: a single right-angle turn. After seven folds: a recognizable dragon head shape. As *n* → ∞, the curve converges to the true Heighway dragon — an infinitely detailed fractal that tiles the plane with four rotated copies of itself.

The fold sequence encodes a binary pattern that mathematicians call the **regular paperfolding sequence**: 1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, … where 1 represents a right turn and 0 a left turn. [This sequence](https://en.wikipedia.org/wiki/Dragon_curve) turns out to have deep connections to number theory.

### Lindenmayer System Description

The dragon curve can also be expressed as an [L-system](https://en.wikipedia.org/wiki/L-system) (a formal rewriting grammar), making it straightforward to generate programmatically:

  - **Axiom:** FX

  - **Rules:** X → X+YF+, Y → −FX−Y

  - **Interpretation:** F = draw forward, + = turn right 90°, − = turn left 90°

This recursive grammar produces exactly the same shape as the paper-folding procedure, and it generalizes naturally to other turn angles and higher dimensions.

### Mathematical Properties at a Glance

  Key properties of the Heighway dragon curve

      Property
      Value / Description

      Curve (interior) Hausdorff dimension
      2 — the curve itself is space-filling

      Boundary Hausdorff dimension
      ≈ 1.523627 — a genuine fractal boundary

      Self-intersection
      None — the curve never crosses itself

      Tiling
      Two Heighway dragons tile the plane (the twindragon)

      Four copies tile the plane
      Yes — with rotational symmetry

      Similarity ratio at each step
      1/√2 (scaled and rotated 45°)

The boundary dimension of ≈ 1.523627 was established through the foundational work of mathematicians [Chandler Davis and Donald Knuth](https://link.springer.com/article/10.1007/s00283-013-9428-y) in their 1970 paper *Number representations and dragon curves* (*Journal of Recreational Mathematics*, vol. 3). Their analysis showed that the boundary consists of two self-similar pieces, each scaled by ratios of 1/√2 and 1/(2√2), yielding the characteristic non-integer dimension.

## How Do You Fold a Dragon Curve Fractal Step by Step?

The paper-folding method is the most tactile way to meet the dragon curve, and it requires nothing more than a strip of paper and patience.

  - **Start** with a long, thin strip — a strip cut from A4 paper works well.

  - **First fold:** Hold both ends and fold the right end over to the left, so the strip doubles. Crease firmly. You now have one fold and two layers.

  - **Second fold:** Without rotating the strip, fold the right end over to the left again. Two folds, four layers.

  - **Continue folding** in the same direction. Seven or eight folds is typically the practical limit — the stack becomes too thick.

  - **Unfold** carefully, bending each crease to a precise 90° angle rather than flattening it back. View the strip from above.

  - **Observe:** Even at five or six iterations, the characteristic dragon silhouette is clearly visible — a coiling, asymmetric curve that almost but never quite closes back on itself.

The remarkable fact is that *no two segments of the unfolded strip ever overlap*, regardless of how many times you fold. This non-self-intersection property was rigorously proved by Davis and Knuth and is one of the curve's most surprising mathematical guarantees.

Mathematician Natalija Budinski explored the pedagogical power of this construction in her 2017 paper [Folding the Dragon Curve Fractal](https://archive.bridgesmathart.org/2017/bridges2017-573.pdf) (Bridges Math Art Conference), demonstrating how paper folding provides students an immediate, physical intuition for recursive self-similarity.

## What Are Space-Filling Curves, and Why Do They Matter?

The dragon curve belongs to the broader family of **space-filling curves**: continuous paths that, in their infinite limit, pass through every point of a region in the plane. These objects profoundly shook 19th-century mathematics by demonstrating that a line — naively a one-dimensional thing — could, through continuous deformation alone, reach every point in two-dimensional space.

Before 1890, mathematicians largely assumed that dimension was topologically stable: a line could not be mapped continuously onto a square without tearing. Giuseppe Peano proved otherwise, and the resulting wave of mathematical analysis reshaped our understanding of continuity, dimension, and the nature of curves themselves. See our companion article on [fractal dimension](https://fractal.us/mathematics/fractal-dimension) for the formal framework.

### The Peano Curve (1890): The First Space-Filler

**Giuseppe Peano** (1858–1932), an Italian mathematician celebrated for his axioms of arithmetic, published the first space-filling curve in 1890 in the journal *Mathematische Annalen*. His paper, [Sur une courbe, qui remplit toute une aire plane](https://mathshistory.st-andrews.ac.uk/Biographies/Peano/) — that is, *On a curve that fills an entire planar region* — gave a purely analytical definition: no diagram, no geometric picture, just a pair of functions mapping the unit interval onto the unit square.

Peano's construction divided the unit interval into nine equal sub-intervals and mapped them onto nine sub-squares in a specific order, then repeated the subdivision recursively within each sub-square. The result: a continuous path through every point of the square. The mathematical community was stunned. As [MacTutor records](https://mathshistory.st-andrews.ac.uk/Biographies/Peano/), it had been thought that such curves could not exist.

The Peano curve has fractal dimension 2 — it genuinely fills the plane — but its construction is less geometrically intuitive than the Hilbert curve that followed.

### The Hilbert Curve (1891): Geometry Made Visible

One year after Peano, German mathematician **David Hilbert** (1862–1943) published a variant in the same journal: *Über die stetige Abbildung einer Linie auf ein Flächenstück* — on the continuous mapping of a line onto a surface piece. Hilbert's innovation was geometric clarity. Where Peano provided an analytic formula, Hilbert drew a picture — an iterative construction so visually transparent that it became the canonical example of a space-filling curve.

The Hilbert curve is built by dividing the unit square into four quadrants and connecting them in a U-shape, then replacing each quadrant with a smaller rotated copy of the same U-pattern, and repeating. As the [Wikipedia article on the Hilbert curve](https://en.wikipedia.org/wiki/Hilbert_curve) notes, the first published diagram of any space-filling curve appeared in Hilbert's 1891 paper.

The Hilbert curve has a remarkable **locality-preserving** property: points that are close together along the 1D path tend to remain close together in 2D space. This makes the Hilbert curve enormously useful in computing — database spatial indexing (used by systems like [Databricks liquid clustering](https://towardsdatascience.com/spatial-index-space-filling-curves-e67baec2186a/)), image compression, parallel mesh partitioning in computational fluid dynamics, and cache-oblivious algorithms all exploit this property. The Hilbert curve consistently outperforms the simpler Z-order (Morton) curve on locality metrics.

Like the Peano curve, the Hilbert curve itself has Hausdorff dimension 2 — its image is the entire unit square. Yet topologically it is a continuous image of the unit interval: a line that has been folded infinitely to fill a plane.

### The Cantor Set (1883): Fractal Subtraction

The **Cantor set** arrives in this family from the opposite direction — not by adding complexity through folding, but by *removing* it through infinite deletion.

Georg Cantor (1845–1918) introduced his celebrated set in 1883, in his paper *Grundlagen einer allgemeinen Mannigfaltigkeitslehre*. The construction is elegant in its severity: begin with the closed interval [0, 1]. Remove the open middle third (1/3, 2/3). Remove the middle third of each remaining segment. Repeat infinitely.

What remains after infinitely many deletions is the **Cantor ternary set**: uncountably infinite in cardinality (as many points as the entire real line), yet of *total measure zero* — it occupies no length whatsoever. As the [Wikipedia article on the Cantor set](https://en.wikipedia.org/wiki/Cantor_set) notes, it is the archetypal example of a set that is simultaneously large (uncountably infinite) and small (measure zero).

The Hausdorff dimension of the Cantor ternary set is:

**DH = ln(2) / ln(3) ≈ 0.6309**

This non-integer dimension — less than 1, more than 0 — captures precisely the dust-like nature of the set: too sparse to be a line, too numerous to be a finite collection of points. Mandelbrot called structures like this *Cantor dust* and used them as models for discontinuous natural phenomena — the distribution of galaxies, the clustering of errors in communication channels, the gaps in Saturn's rings.

For a deeper treatment of how these dimension concepts connect to the full range of known fractals, see our guide to [types of fractals](https://fractal.us/mathematics/types-of-fractals).

## Why Did These Curves Shock Nineteenth-Century Mathematicians?

To appreciate the depth of the disturbance these objects caused, it helps to understand what mathematicians believed before 1883–1891.

The prevailing intuition, rooted in Euclidean geometry, was that dimension was an intrinsic, stable property: a line was one-dimensional, a surface two-dimensional, and no continuous deformation could change that. Cantor had already unsettled this belief in 1878 when he wrote to Richard Dedekind: *I see it, but I do not believe it* — referring to his proof that the line and the plane have the same cardinality (the same number of points). But cardinality-preserving maps need not be continuous.

Peano's 1890 construction demolished the remaining comfort: a *continuous* curve — the kind of thing you might physically draw without lifting your pen — could pass through every point in a 2D region. This meant that the naive definition of curve was fatally ambiguous. The Italian mathematician Camille Jordan had famously struggled to define a curve precisely enough to prove the Jordan curve theorem, and Peano's result showed just how necessary such precision was.

The mathematical response over the following decade was a burst of foundational work: rigorous topology, measure theory, and eventually, in the 20th century, the framework of Hausdorff dimension that gives each of these objects a precise fractional size between the integers.

Mandelbrot later wrote that the Cantor set and its relatives — the mathematical monsters of the 1880s–1910s — were not pathological curiosities but the natural geometry of roughness, discontinuity, and complexity. His *Fractal Geometry of Nature* (1982) unified these scattered objects under the single concept of the fractal, arguing that they describe the real world far better than smooth Euclidean shapes. Read our [complete guide to what a fractal is](https://fractal.us/what-is-a-fractal) for the full story.

## Real-World Applications of Space-Filling Curves

Space-filling curves are not merely historical curiosities. Their locality-preserving properties and ability to map multi-dimensional data onto one dimension make them practical tools across a range of modern fields.

  Applications of space-filling curves in science and technology

      Field
      Curve Used
      Application

      Database indexing
      Hilbert curve
      Spatial indexing of geographic data; Databricks liquid clustering

      Image processing
      Hilbert curve
      Fractal scan-path pixel ordering improves compression and cache coherence

      Parallel computing
      Hilbert / Peano
      Domain decomposition and load balancing in computational fluid dynamics meshes

      Combinatorial optimization
      Hilbert / Z-order
      Heuristic solutions to the traveling salesman problem

      Telecommunications
      Cantor set, Koch curve
      Fractal antenna design — more bandwidth in smaller form factors

      Signal analysis
      Cantor set
      Modeling intermittent noise and error clustering in transmission channels

      Astrophysics
      Cantor dust
      Modeling the fractal distribution of matter in the large-scale universe

The [2020 arXiv paper](https://arxiv.org/abs/2008.01684) *Space-filling Curves for High-performance Data Mining* surveys how modern data mining exploits these 19th-century constructions to handle billion-record datasets efficiently — a striking example of pure mathematics finding applications more than a century after its creation.

## How Does the Dragon Curve Relate to Jurassic Park?

The dragon curve's most famous pop-culture moment came in Michael Crichton's 1990 novel *Jurassic Park*. Each section of the book opens with a print of the Heighway dragon at successive iterations, illustrating the novel's central theme: complex, seemingly controlled systems — like a dinosaur theme park — harbor emergent, unpredictable behavior that no blueprint can fully anticipate.

Ian Malcolm, the novel's mathematician character, is a chaos theorist, and the dragon curve serves as his visual emblem — a reminder that simple iterative rules (fold the paper; repeat) produce outcomes of breathtaking complexity. The choice was scientifically precise: the Heighway dragon is generated by deterministic iteration, yet its full behavior at high iteration counts is practically impossible to predict without running the process. This is the essence of deterministic chaos.

Martin Gardner had already popularized the curve in his *Scientific American* *Mathematical Games* column in April 1967 (vol. 216, no. 4, pp. 116–123), introducing it to recreational mathematicians. Crichton almost certainly encountered it there.

## Sources

1. [https://en.wikipedia.org/wiki/Dragon_curve](https://en.wikipedia.org/wiki/Dragon_curve)
2. [https://larryriddle.agnesscott.org/ifs/heighway/heighway.htm](https://larryriddle.agnesscott.org/ifs/heighway/heighway.htm)
3. [https://link.springer.com/article/10.1007/s00283-013-9428-y](https://link.springer.com/article/10.1007/s00283-013-9428-y)
4. [https://archive.bridgesmathart.org/2017/bridges2017-573.pdf](https://archive.bridgesmathart.org/2017/bridges2017-573.pdf)
5. [https://arxiv.org/html/2506.05541](https://arxiv.org/html/2506.05541)
6. [https://en.wikipedia.org/wiki/Hilbert_curve](https://en.wikipedia.org/wiki/Hilbert_curve)
7. [https://mathshistory.st-andrews.ac.uk/Biographies/Peano/](https://mathshistory.st-andrews.ac.uk/Biographies/Peano/)
8. [https://en.wikipedia.org/wiki/Space-filling_curve](https://en.wikipedia.org/wiki/Space-filling_curve)
9. [https://en.wikipedia.org/wiki/Cantor_set](https://en.wikipedia.org/wiki/Cantor_set)
10. [https://galileo-unbound.blog/2020/12/26/a-short-history-of-fractal-dimension/](https://galileo-unbound.blog/2020/12/26/a-short-history-of-fractal-dimension/)
11. [https://mathworld.wolfram.com/DragonCurve.html](https://mathworld.wolfram.com/DragonCurve.html)
12. [https://mathworld.wolfram.com/CantorSet.html](https://mathworld.wolfram.com/CantorSet.html)
13. [https://arxiv.org/abs/2008.01684](https://arxiv.org/abs/2008.01684)
14. [https://towardsdatascience.com/spatial-index-space-filling-curves-e67baec2186a/](https://towardsdatascience.com/spatial-index-space-filling-curves-e67baec2186a/)
15. [https://www.americanscientist.org/article/crinkly-curves](https://www.americanscientist.org/article/crinkly-curves)

---
Source: https://fractal.us/famous-fractals/dragon-curve
Index: https://fractal.us/llms.txt · Full text: https://fractal.us/llms-full.txt
