## Dragon Curve Visualization

Maple , Maple Learn

The Lunar New Year is approaching and 2024 is the Year of the Dragon! This inspired me to create a visualization approximating the dragon curve in Maple Learn, using Maple.

The dragon curve, first described by physicist John Heighway, is a fractal that can be constructed by starting with a single edge and then continually performing the following iteration process:

Starting at one endpoint of the curve, traverse the curve and build right triangles on alternating sides of each edge on the curve. Then, remove all the original edges to obtain the next iteration.

This process continues indefinitely, so while we can’t draw the fractal perfectly, we can approximate it using a Lindenmayer system. In fact, Maple can do all the heavy lifting with the tools found in the Fractals package, which includes the LSystem subpackage to build your own Lindenmayer systems. The subpackage also contains different examples of fractals, including the dragon curve. Check out the Maple help pages here:

Using this subpackage, I created a Maple script (link) to generate a Maple Learn document (link) to visualize the earlier iterations of the approximated dragon curve. Here’s what iteration 11 looks like:

You can also add copies of the dragon curve, displayed at different initial angles, to visualize how they can fit together. Here are four copies of the 13th iteration:

Mathematics is full of beauty and fractals are no exception. Check out the LSystemExamples subpackage to see many more examples.

Happy Lunar New Year!

﻿