Staaarter

Generate a Heighway Triangle

Generates a triangular-angle variant of the Heighway dragon curve: the same axiom and production rules as the classic dragon curve, drawn at a 60-degree turn angle instead of the usual 90 degrees. Renders as a downloadable SVG or PNG line drawing. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-08-05
By Staaarter Team
fractalgeneratorsvg

Overview

Introduction

The classic Heighway dragon curve is built by repeatedly folding a strip of paper in half and unfolding each crease to a right angle, which is why its standard turtle-graphics rendering always uses a 90-degree turn.

This tool keeps the dragon curve's exact axiom and production rules but swaps that 90-degree turn for 60 degrees, producing a triangular-angle variant we call the Heighway Triangle. It's a deliberate reuse of the same rules at a different angle, not a separately documented classical curve.

What Is Generate a Heighway Triangle?

A turtle-graphics renderer that runs the Heighway dragon curve's L-system, axiom FX, rules X to X+YF+ and Y to -FX-Y, at a fixed 60-degree turn angle instead of the dragon curve's usual 90 degrees.

The result is our own angle variant on the Heighway dragon construction: same rewriting rules, same rule structure, different geometry because the turn angle changes.

How Generate a Heighway Triangle Works

The tool expands the axiom FX using the production rules X to X+YF+ and Y to -FX-Y for the chosen iteration count, exactly as the classic dragon curve does.

The expanded string is then interpreted by a turtle-graphics engine at a 60-degree turn angle: F draws forward, plus and minus pivot by 60 degrees, and X/Y contribute no drawing of their own, they only steer how F gets placed on later iterations.

The resulting line segments are rescaled into the SVG viewbox and rendered as one connected path, exportable as SVG or PNG.

When To Use Generate a Heighway Triangle

Use it when you want a fractal with the dragon curve's self-similar folding structure but a triangular, rather than right-angled, visual character.

It's a good example for demonstrating how much a fractal's silhouette depends on the turn angle, independent of the underlying rewriting rules, alongside the Dragon Curve Generator at the classic 90 degrees.

If you specifically need the real, documented Heighway dragon curve for academic or reference purposes, use the Dragon Curve Generator instead, this tool is a stylistic variant, not the classical curve.

Features

Advantages

  • Demonstrates clearly how turn angle alone reshapes a fractal built from otherwise unchanged L-system rules.
  • Produces a distinctive triangular silhouette that the standard 90-degree dragon curve doesn't.
  • One-click SVG and PNG export of the rendered curve.

Limitations

  • Not a classical, independently documented fractal, it's our own 60-degree variant of the Heighway dragon curve's rules, and should be labeled as such in any academic or citation context.
  • The turn angle is fixed at 60 degrees; use the L-system Generator if you want to try other angles on the same axiom and rules.

Examples

Low iteration count

Input

Iterations: 2

Output

A short, angular zigzag made of a handful of 60-degree turns.

At low iteration counts the curve's basic folding step is visible before the self-similar detail builds up.

Default iteration count

Input

Iterations: 9

Output

A dense, triangular-looking fractal silhouette rendered across the SVG canvas.

By iteration 9 the repeated 60-degree folds compound into a visually distinct triangular structure, in contrast to the classic dragon curve's right-angled look at the same iteration count.

Best Practices & Notes

Best Practices

  • Compare this tool's output against the Dragon Curve Generator at the same iteration count to see exactly how much the 60-degree angle changes the silhouette versus the standard 90 degrees.
  • Start at a low iteration count (2 to 4) to see the basic folding pattern clearly before increasing to the denser default.

Developer Notes

This tool reuses the Heighway dragon curve's axiom (FX) and production rules (X to X+YF+, Y to -FX-Y) but draws them at a 60-degree turn angle rather than the dragon curve's standard 90 degrees, bounded to iterations 0 through 13 (`HEIGHWAY_TRIANGLE_GENERATOR_BOUNDS`); this is a deliberate, clearly-labeled angle variant of our own, not a separately documented classical curve, and the preset table's comment says so explicitly to avoid implying a fake citation.

Generate a Heighway Triangle Use Cases

  • Exploring how turn angle alone changes a fractal's silhouette when the L-system rules stay fixed
  • Generating a distinctive triangular fractal for a design or illustration
  • Teaching the relationship between an L-system's rewriting rules and its turtle-graphics interpretation angle

Common Mistakes

  • Citing this tool's output as "the Heighway triangle" in an academic context as if it were a separately documented classical fractal, it's our own angle variant on the Heighway dragon rules.
  • Confusing this tool with the Dragon Curve Generator, they share the same axiom and rules but render at different angles and therefore look quite different.

Tips

  • If you want the real, citable Heighway dragon curve, use the Dragon Curve Generator, this tool exists specifically for the 60-degree variant.
  • Try reproducing this angle yourself in the L-system Generator by entering axiom FX, rules X=X+YF+ and Y=-FX-Y, and angle 60, to see the exact same construction in the general-purpose tool.

References

Frequently Asked Questions