Dragon curve generator
Fold a strip of paper in half, and again, and again. Open every crease to a right angle and the strip draws a dragon. Grow the curve one fold at a time and watch each new half swing out from the end of the old one, exactly as the paper unfolds. After a dozen folds the dragon has thousands of corners, touches itself everywhere and still never crosses. Colour it along its length or by its copies, round the corners, and compare it with its relatives: the twin dragon, four dragons around a point, the terdragon and the Lévy C curve. Fold a strip of paper in half again and again, then open every crease to a right angle: the strip traces the Heighway dragon. Press Play to grow the dragon level by level and watch each new copy swing out from the end of the curve, like the paper unfolding, or Step to add one level. Choose the twin dragon, four dragons around a point, the terdragon or the Lévy C curve, colour the curve along its length or by its copies, and round the corners to see that the dragon touches itself but never crosses. The tiles give the number of segments, the length, the fractal dimension and the points the curve visits twice; the row under the picture shows the creases of the paper strip.
How it works
- Press Play to unfold the dragon one level at a time, or Step to add a single fold; drag Level to jump to any level.
- Choose the Heighway dragon, the twin dragon, four dragons around a point, the terdragon or the Lévy C curve.
- Colour the curve along its length, by copy or in one colour, and round the corners to see that it never crosses itself.
- Read the number of segments, the length, the fractal dimension and the double points in the tiles, and the creases of the paper strip under the picture.
From a paper strip to a dragon
A strip folded n times has 2ⁿ layers and, once unfolded, 2ⁿ − 1 creases. Seen from one side each crease is a valley (∨) or a mountain (∧), and the order is fixed: ∧, then ∧∧∨, then ∧∧∨∧∧∨∨. Every row is the row before, one new crease, and the row before again in reverse with each crease flipped. Open all creases to 90° and the strip is the dragon of level n. Undoing the last fold is the animation: the second half of the curve is a copy of the first half that swings out around the point where they meet.
It fills an area without crossing itself
Every level doubles the number of segments and makes them 1/√2 as long, so the curve becomes √2 times longer each time while its two ends stay put. Two copies at a scale of 1/√2 give a fractal dimension of log 2 / log √2 = 2: the finished dragon covers an area, and only its border, with a dimension of about 1.524, is a fractal line. From level 4 on the curve returns to corners it has visited before, but it turns away there instead of crossing, and it never draws a segment twice. With rounded corners you can follow it as a single thread.
Twin dragon, terdragon and Lévy C curve
Two dragons back to back form the twin dragon, a shape that tiles the plane, and four dragons from one point fill the plane around it; colour them by copy to see how they interlock. The terdragon replaces every segment by three with turns of 120° and lives on a grid of triangles; its border has the dimension of the Koch curve, log 4 / log 3 ≈ 1.262. The Lévy C curve bends every segment to the same side, without the dragon's alternation. It is the only one of the five that runs over its own segments, as the last tile shows.
Frequently asked questions
How do you make a dragon curve from paper?
Fold a long strip of paper in half, always in the same direction, as many times as you can: five or six folds work well. Unfold it and open every crease to a right angle, so that the strip stands on its edge in a zigzag. Seen from above it is the dragon curve of that level, and the generator draws the same shape for the same number of folds.
Does the dragon curve ever cross itself?
No. From level 4 on it comes back to corners it has visited before, but each time it turns away rather than crossing, and no segment is ever drawn twice. Switch on Round the corners to see this: the curve becomes one thread that never crosses. The Double points tile counts the corners the curve visits twice.
What do the ∨ and ∧ signs under the picture mean?
They are the creases of the unfolded paper strip, in order: ∧ is a mountain fold and ∨ a valley fold, which are the left and right turns of the curve. The row for each level is the row before, a new ∧, and the row before in reverse with every crease flipped. It is known as the regular paper-folding sequence and it never repeats.
What are the twin dragon and the terdragon?
The twin dragon is two Heighway dragons back to back, one turned half a turn; copies of it cover the plane without gaps. The terdragon follows the same idea with three pieces per segment and turns of 120° instead of two pieces and turns of 90°. Both were described by Chandler Davis and Donald Knuth in 1970.
How is the Lévy C curve different?
It uses the same step as the dragon, replacing every segment by two at a right angle, but always bends to the same side, where the dragon alternates left and right. The result looks like a letter C covered in curls, and unlike the dragon it does run over segments it has drawn before.
Ready to try it?
Open PictorX in your browser — no install, no credit card required to start.
Go to Editor