Desmos Mandelbrot Set

A couple ways to create the Mandelbrot set in Desmos

The Mandelbrot set is a set of complex numbers defined by the equation: $$ z_{n+1} = z_n^2 + c $$ where $z$ is a complex number and $c$ is a constant complex number. The set is defined as the set of all complex numbers $c$ for which the sequence does not diverge when starting with $z_0 = 0$.

When I first implemented the Mandelbrot set in Desmos, we didn’t have recursion or actions available, so I had to use a workaround with just repeating the same function over and over again. This is pretty inefficient (the window below might take awhile to load), but it works.

A grid using Vogel’s model can cram more points into the same space, allowing for a more detailed view of the Mandelbrot set. This is why sunflowers and pinecones have that spiral pattern, as it allows for the most efficient packing of seeds or scales.

Then actions got added to Desmos, which allowed us to do recursion by adding steps to the function. Here you could choose how many iterations you wanted to run, but it was still pretty slow for large numbers of iterations.

Finally, we got recursion, which allows us to create the Mandelbrot set in a much more efficient way. This is the current implementation, which is much faster, loading quite a bit faster than the previous ones.