Mandelbrot

Consider a sequence of complex numbers defined by \[ z_{n+1} = z_n^2+c \text{ where } z_0 = 0 \] for some constant $c$. Depending on the constant $c$, the sequence will either diverge or not. In the picture above, the cursor position $(x_m,y_m)$ is represented as a complex number $z=x_m+i y_m$ which corresponds to the complex number $c$. A white line (starting from $z_0=0$) is drawn between each point $z_n$ to the next $z_{n+1}$ during the iteration. If the sequence starts to diverge ($|z_n|\geq 2$) the sequence is terminated and the number $n$ is stored. The number $n$ then determines the color of that point according to some arbitrary cycle of colors. If it never starts, it is colored black. The image resulting from doing this at every point is displayed.

You can move around in the complex plane by dragging, zoom with pinch gestures or UP/DOWN arrow keys. The fractal is rendered in real time using a WebGL shader with up to 500 iterations per pixel.

March 1, 2026