Draw a Triangle-Dragon Fractal screenshot

Draw a Triangle-Dragon Fractal

Draw the terdragon: the triangular-lattice dragon built from F to F+F-F at 120 degrees, with both mirror senses.

Privacy First
0 Runs
Updated 2026-11-06
No upload
Runs in this tab

The dragon on a triangular lattice

The terdragon is the dragon curve's triangular cousin. The rule is F becomes F+F-F at 120 degrees per turn, so each stroke splits into three and the path bends on a triangular grid rather than the square one the Heighway dragon uses. Every level multiplies the stroke count by three, giving 3^n strokes at depth n.

Depth is capped at eight, which is 6,561 strokes. One more step is 19,683 strokes for detail the canvas cannot resolve, and the rewrite is rebuilt per redraw. The turn sense can be flipped: turning left and turning right produce the same curve mirrored, so both readings are the terdragon.

The symbol F and the rewrite are the whole state, so the drawing is deterministic. Reloading reproduces the identical curve, and nothing is fetched or stored.

Draw a terdragon (triangle dragon) where each stroke splits into three and every turn is 120°, in either the left or the right reading.

Both readings are the same curve: the second is the first mirrored, and the depth you set decides how much of it is drawn.

How to use it

Set the depth and choose the left or right turn rule, then press Draw or Animate. Stop ends the animation, and the status line names the stroke count at the depth drawn.

The rule

F+F−F and F−F+F are the two readings of the same terdragon, with 120° turns that keep the path on the triangular lattice. Mirroring one gives the other, which is why the page calls them readings rather than variants.

Where it stops

Depth is capped at 8, because each stroke splits into three and one more step would be 19,683 strokes — past what the canvas resolves. There is no export and no seed.

What to Expect

Best for

  • comparing the two readings of one terdragon
  • seeing a triangular-lattice space-filling curve

What this tool keeps

  • The rewrite and the drawing run in this tab; nothing is uploaded and nothing is kept.

Frequently asked questions

What is the difference between the two turn options?

Nothing but mirroring. F+F−F and F−F+F are the same terdragon read two ways, and the page draws whichever you select at the depth you set.

Why are the turns 120°?

Because that is the triangular-lattice rule: a 120° turn keeps the path on the hexagonal grid the terdragon is defined on.

Why stop at depth 8?

Because each stroke splits into three, so one more step is 19,683 strokes — more than this canvas can resolve.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.