A fractal is a never-ending pattern that repeats itself at all scales. Fractals are found everywhere in nature. We find them in our blood vessels, branches of trees, and in the structure of our galaxies, and the beauty of them lies in the fact that they are made out of simple formulas.
We will demonstrate the simplicity of these seemingly complex-looking phenomena by drawing a fractal named a Mandelbrot set. We assume a basic knowledge of set theory and complex numbers in this section. Our code produces a Mandelbrot set that looks like the following diagram:
The Mandelbrot set is defined as a set of complex numbers, c:
So that the complex number c obeys the following recurrence relation:
Think of recurrence relations as functions where the last output is fed as input into the same function in the next iteration.
So the Mandelbrot set is a set that only includes...