Michael Bradford Williams

Home / Programming / Mandelbrot Set

The Mandelbrot set is one of the most well-known fractals. It is the subset of the plane (treated as the set of complex numbers \(\mathbb{C}\)) that behaves in a controlled way under repeated applications of a certain function from the plane to itself. More specifically, for \(c \in \mathbb{C}\), define the function \(f_c: \mathbb{C} \rightarrow \mathbb{C}\) by \(f_{c}(z) = z^{2} + c\). We can repeatedly apply this function, starting at \(z_0=0\), to get a sequence \((z_n)_{n=0}^\infty\) defined by \[ \begin{align*} z_0 &= 0 \\ z_1 &= f_c(z_0) = 0^2 + c = c \\ z_2 &= f_c(z_1) = c^2 + c \\ z_3 &= f_c(z_2) = (c^2 + c)^2 + c \\ &\vdots \\ z_n &= f_c(z_{n-1}) \\ &\vdots \end{align*} \] Finally, the Mandelbrot set is defined as the set \[ M := \{ c \in \mathbb{C} : (z_n)_{n=0}^\infty \text{ is a bounded sequence}\}. \]

Below is an app to draw the Mandelbrot set. Click to zoom, and shift-click to zoom out. Technically, only the black portion of the drawing is the Mandelrot set. The non-black points correspond to values of \(c\) whose sequences are unbounded, and the color is assigned based on how many iterations of \(f_c\) are needed before the sequence reaches a certain distance from the origin.

Here is a larger version of the program.

Your browser is currently unsupported.