Overview
Introduction
The twindragon, also known as the Davis-Knuth dragon after the mathematicians who studied it, is formed by joining two Heighway dragon curves back to back so their combined outline can tile the plane.
This tool renders it at any iteration count from 0 to 15 using its standard Lindenmayer-system definition, so you can see the two joined dragon lobes and download the result as SVG or PNG line art.
What Is Generate a Twindragon Curve?
A generator for the twindragon curve, built from a Lindenmayer system with axiom FX+FX+ and production rules X to X+YF and Y to FX-Y, drawn at a 90-degree turn angle.
The only input is an iteration count (labeled "Iterations" in the tool); the axiom, rules, and angle are fixed to the curve's standard, documented definition.
How Generate a Twindragon Curve Works
The generator expands the axiom FX+FX+ using the rules X to X+YF and Y to FX-Y, repeated for the chosen iteration count, at a fixed 90-degree turn angle.
The expanded string is walked by a turtle-graphics interpreter: F moves forward and draws a segment, plus and minus turn 90 degrees left or right, and X/Y draw nothing themselves, they only steer how F gets placed as the rules unfold.
The resulting segments are rescaled to fit the SVG viewbox and rendered as a single connected path.
When To Use Generate a Twindragon Curve
Use it to see the twindragon's distinctive two-lobed structure, useful for illustrating plane-tiling fractals or comparing dragon-family variants side by side.
It's a quick way to generate exportable line art of the curve without implementing the L-system expansion yourself.
If you want the single, non-joined Heighway dragon instead, use the Dragon Curve Generator; for the ternary variant, use the Terdragon Curve Generator.
Often used alongside Generate a Dragon Curve, Generate a Terdragon Curve and L-system Generator.
Features
Advantages
- Uses the twindragon's real, documented L-system definition and 90-degree angle.
- Iteration count is validated against the curve's sane bounds (0 to 15).
- One-click SVG and PNG export of the rendered curve.
Limitations
- Fixed to the standard twindragon construction, no custom axiom, rules, or angle; use the L-system Generator for that.
- At high iteration counts the two joined lobes become dense enough that individual segments are hard to distinguish visually.
Examples
Best Practices & Notes
Best Practices
- Compare this tool's output against the Dragon Curve Generator at the same iteration count to see how the doubled axiom changes the overall silhouette.
- Step through iterations 3 through 7 first to see the two-lobed structure build up before jumping to the dense default.
Developer Notes
The preset uses axiom FX+FX+ with rules X to X+YF and Y to FX-Y at a fixed 90-degree turn angle, bounded to iterations 0 through 15 (`TWINDRAGON_CURVE_GENERATOR_BOUNDS`), dispatched through the shared `generateFractalFromPreset("twindragon-curve", iterations)` helper that every named-curve tool in this category reuses.
Generate a Twindragon Curve Use Cases
- Generating reference line art of the twindragon curve for teaching plane-tiling fractals
- Producing a downloadable SVG of the curve for a design or data-visualization project
- Comparing the twindragon against the single dragon curve and terdragon side by side
Common Mistakes
- Assuming the twindragon is simply the dragon curve mirrored, it's actually built from a different axiom (FX+FX+) that joins two dragon-curve copies at a shared point, not a simple reflection.
- Expecting the rendered curve at a single iteration count to visibly demonstrate plane-tiling, that property only becomes apparent when multiple copies of the shape are arranged together, which this tool doesn't do automatically.
Tips
- Download two copies at the same iteration count and rotate one in an external editor to see how they interlock, since that's the basis of the twindragon's tiling property.
- Compare against the Terdragon Curve Generator to see how a ternary, 120-degree rule set produces a very differently shaped dragon-family fractal.