Free online tools to generate, calculate,
convert, format, encode, and play.
 

Dragon Curve Generator

Generate and visualize Heighway dragon curves with adjustable depth, colors, and line width. All rendering happens in your browser in real time.


Preview

Controls

12
1

About

The Heighway dragon curve was first described by NASA physicists John Heighway, Bruce Banks, and William Harter. It can be created by repeatedly folding a strip of paper in half in the same direction, then unfolding to 90-degree angles. Two dragon curves tile the plane when placed back-to-back. The Hausdorff dimension is 2. The boundary of the dragon curve is itself a fractal.

The algorithm works by iteratively building a sequence of turns. Start with a single right turn [R]. Each iteration takes the current sequence, appends R, then appends the reverse of the sequence with each turn flipped (R becomes L, L becomes R). To draw: start heading right, and for each turn in the sequence, rotate 90 degrees in that direction and draw a unit-length segment. The result is scaled and centered to fit the canvas.



Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with