Main menuGallery

Mandelbrot & Julia sets

Mandelbrot set
Julia set

Mandelbrot & Julia

Go to
Iterations 250
Colours
Colour shift
Band spacing
View
Precision

Drag to pan · scroll or pinch to zoom · click a point to choose c · with the picture focused, arrow keys pan and + / zoom.

Orbit of z → z² + c

What's the maths?

Where's the maths? This picture is made by a quadratic function used over and over again, so it belongs to algebra — the same y = ax² + bx + c family you graph in Sec 2 — married to coordinate geometry, the Cartesian grid you have used since Sec 1. Pick any point on the grid and call it c. Start at zero and repeatedly apply the rule z → z² + c, feeding each answer back in as the next input. Some starting points keep their answers small forever; others send them racing off to infinity. Colour every point by which of those two things happens — and how quickly — and this shape appears, with no artist and no drawing instructions anywhere. The only extra ingredient beyond your syllabus is that the points are treated as complex numbers, which just means each point (x, y) is squared by a fixed rule that mixes its two coordinates. Everything you see is one line of algebra, iterated.

📘 On the Sec 1–4 syllabus
  • Sec 2 · N6 — 6.6 quadratic functions y = ax² + bx + c (the rule z → z² + c)
  • Sec 1 · N6 — 6.1 Cartesian coordinates

Beyond the syllabus: complex numbers and fractals — enrichment.

A point of the plane is written c = a + bi, where a is its x-coordinate, b is its y-coordinate, and i is a symbol obeying i² = −1. Squaring is then ordinary expansion of a bracket, exactly as in Sec 2:

(x + yi)² = x² − y² + 2xy·i

So the whole fractal is the pair of real formulas xnew = x² − y² + a and ynew = 2xy + b, applied again and again. The orbit panel shows this happening for the point you clicked: the dots are z0 = 0, z1 = c, z2 = c² + c, and so on.

The Mandelbrot set is the collection of points c whose orbit never runs away. There is a clean test: once a point of the orbit is further than 2 from the origin it can never come back, so it must escape. That dashed circle of radius 2 is drawn on the orbit panel. Points inside the set are painted dark; every other point is coloured by how many steps it survived before crossing the circle — that is what the colour bands are counting.

A Julia set reverses the roles. Now c is held fixed and the starting point is moved around the plane; the Julia set separates the starting points that stay bounded from those that escape. Turn on Julia view and sweep across the Mandelbrot: when c sits inside the black set the Julia picture is one connected piece, and the moment c leaves it the Julia picture shatters into dust. The Mandelbrot set is precisely the map of which c values give connected Julia sets.

Zoom in and the same shapes return at every scale — a copy of the whole set is hiding inside every filament. That property is called self-similarity, and a shape with it is a fractal. The boundary is infinitely crinkled: it has finite area around it but no sensible length, which is why zooming never smooths it out the way zooming on a circle would. What does eventually stop us is arithmetic, not geometry — the graphics card stores each coordinate in about 7 significant figures, so past roughly 10⁵× magnification neighbouring pixels get the same number and the picture goes blocky. The Precision menu swaps in a trick that glues two of those numbers together to carry about 15 figures, which buys another five zeros of zoom.

Try this: click on a point well inside the black region and read the orbit — the dots settle down or cycle round a few positions forever. Now click just outside the boundary and watch the same orbit wander for twenty or thirty steps before suddenly shooting past the circle. Then turn on Julia view and move slowly across the edge of the set: find the exact place where the Julia picture stops being one connected island and breaks into scattered dust. That edge is the Mandelbrot set.

Controls: drag to pan · scroll or pinch to zoom · click to choose c and pin it · arrow keys pan, + / − zoom.