🌀 Mandelbrot Set

Centre Re-0.5
Centre Im0.0
Zoom
Iterations300

Scroll wheel to zoom toward the cursor. Drag to pan. Double-click to zoom in. The fractal is rendered live on the GPU.

—0.5, 0.0 · 1×

The Mandelbrot Set

The Mandelbrot set is the set of complex numbers c for which the iteration $z_{n+1} = z_n^2 + c$ (starting from $z_0 = 0$) remains bounded — i.e. does not escape to infinity. Points inside the set are coloured black; points outside are coloured according to how quickly they escape.

Smooth (continuous) colouring uses the fractional iteration count $\mu = n - \log_2(\log_2|z_n|)$ which removes band artifacts and produces gradients.

How to Explore

Did You Know?

The Mandelbrot set boundary is a fractal: it has infinite perimeter and self-similar structure at every scale of magnification. Zooming in by a factor of 10200 still reveals new structures. A related family, Julia sets, are obtained by fixing c and varying $z_0$; every point in the Mandelbrot set corresponds to a connected Julia set.

About the Mandelbrot Set Explorer

This explorer renders the Mandelbrot set, the set of complex numbers c for which the iteration z(n+1) = z(n)squared + c, starting from z = 0, stays bounded. Each pixel maps to a point c in the complex plane and is iterated in real time on the GPU using a WebGL fragment shader. Points that never escape the bailout radius are drawn black; escaping points are coloured by their escape time.

The Max iterations slider (50 to 1000) sets how long each point is tested, revealing finer detail at deep zoom while rendering more slowly. The Colour dropdown chooses between Fire, Ocean, Psychedelic and Grayscale cosine palettes. Scroll to zoom toward the cursor, drag to pan, double-click to zoom in, or use the Reset and Zoom buttons. Escape-time methods like this underpin antenna design, image compression and procedural texturing.

Frequently Asked Questions

What is the Mandelbrot set?

It is the set of complex numbers c for which the sequence z(n+1) = z(n)squared + c, beginning at z = 0, stays bounded rather than racing off to infinity. Plotted in the complex plane it forms the famous cardioid-and-bulb shape with an infinitely intricate fractal boundary.

How does this simulation compute the image?

Every pixel on the canvas is mapped to a complex coordinate c, then iterated with z = z squared + c on the GPU. If the magnitude of z stays below the bailout radius up to the iteration limit, the pixel is drawn black; otherwise it is coloured by how many steps it took to escape. The whole frame is computed in a WebGL fragment shader.

What does the Max iterations slider do?

It sets the maximum number of times each point is iterated before being declared part of the set, ranging from 50 to 1000 with a default of 300. Higher values resolve thin filaments and fine structure that only appear at deep zoom, but they make rendering slower because every pixel runs the loop more times.

What do the colour palettes represent?

The Fire, Ocean, Psychedelic and Grayscale options are different cosine-based gradients applied to the escape time of each pixel. The colour itself carries no extra mathematical meaning; it simply visualises how quickly a point left the bailout region, turning the smooth escape value into a pleasing band-free gradient.

What is the key equation behind it?

The core rule is z(n+1) = z(n)squared + c, iterated from z = 0, where c is the pixel coordinate in the complex plane. To avoid colour banding the explorer uses smooth colouring, mu = n + 1 minus log2(log2 of the magnitude of z), which gives a continuous escape value instead of a stepped integer count.

Why are some regions left completely black?

Black pixels are points whose iterations never exceed the bailout radius within the iteration limit, so they are treated as belonging to the set. Because the test is capped at the Max iterations value, a few black points are really very slow escapers; raising the slider can reveal that some apparently solid black areas actually contain fine detail.

Is the rendering mathematically accurate?

The escape-time algorithm is exact in principle, but this explorer uses single-precision floating point on the GPU. That is plenty for moderate magnification, yet at extremely deep zoom rounding errors cause the image to become blocky because the available digits run out. Professional deep-zoom tools use arbitrary-precision arithmetic to push much further.

How deep can I zoom before detail stops appearing?

Mathematically the boundary is self-similar at every scale, so structure never truly ends. In practice this simulation is limited by single-precision floating point, which begins to pixelate after roughly a trillion-fold magnification. Until that point, scrolling or double-clicking keeps revealing seahorse valleys, spirals and tiny copies of the whole set.

How is the Mandelbrot set related to Julia sets?

A Julia set fixes the value of c and varies the starting point z, while the Mandelbrot set fixes z = 0 and varies c. Every point inside the Mandelbrot set corresponds to a connected Julia set, so the Mandelbrot set acts as a map or index of which Julia sets are connected versus fragmented dust.

What are real-world uses of escape-time fractals?

Beyond generative art, the escape-time idea informs fractal antenna design, where self-similar shapes pack wide frequency response into a small footprint. Related fractal mathematics appears in image and signal compression, terrain and texture generation for films and games, and in modelling natural patterns such as coastlines and clouds.