The Mandelbrot Set

Centre Zoom

Unfortunately it appears that your browser does not support ECMAScript 6 or the HTML5 <canvas> element. Please consider upgrading to one which does.

The Mandelbrot Set

About the Set

What happens when you perform a simple mathematical operation many times? For example, repeatedly square a complex number Z and add a constant C: Zn+1 = Zn2 + C, starting from Z0 = 0. (If you're not familiar with complex numbers, just think of them as 2-dimensional coordinates like map references: X0 = Y0 = 0, Xn+1 = Xn2 - Yn2; Yn+1 = 2XnYn.)
Z may either get further and further away from the origin, or it may stay close to the centre. What it does depends (in an infinitely-detailed way) on the constant C. The Mandelbrot Set is defined as the set of all values of C for which the magnitude of Z remains bounded. If the magnitude of Z ever exceeds 2, it will always escape.
The image is of the C plane: the points within the set are black, others are coloured according to how quickly they escape. Moving the mouse over the image will produce white dots showing the trajectory of Z as it evolves. Other controls allow you to navigate the plane and zoom in to see progressively more detail.

The Julia set is closely related. It is defined by the same equations but uses a fixed parameter C and variable starting value Z0, and the filled Julia set is the set of values of Z0 for which the magnitude of Z remains bounded. The Julia set is plotted by first clicking a point in the Mandelbrot set to choose C, then switching to the Julia display.

The program uses several tricks to make it (reasonably) fast, but using Javascript there are limits to how far it can go. The deeper you zoom, the slower it will be, especially if much of the image is black, and at very high zoom levels the image will start to lose detail as the floating point numbers run out of precision.

(Note that the zoom levels are logarithmic - level 0 just allows the entire figure to fit on the page, and each increase of 1 unit doubles the magnification.
Zoom level 32 is a magnification of 4294967296 times.)

Mouse controls

Clickto get information about a point.
Drag to pan the image.
Scroll to zoom in and out at a point.
Control-click to zoom out.
Shift-drag to select a region and zoom to it.

Buttons

ResetScale the display to show the entire set
Move toMove the last tapped point to the centre
Zoom inIncrease magnification
Zoom outDecrease magnification
StopStop the current operation
CalculateShow data for the centre point
OrbitShow orbit for the centre point
JuliaSwitch to/from the Julia set with the last tapped point as its parameter
HelpShow this information

Mobile devices

This animation is really designed for desktop computers with a mouse, but it can still be used on mobile devices, though some devices may scale it wrongly. Without a mouse it can't show continuously-updated coordinates or orbits, but tapping 'Move to' will move the last point tapped to the centre, and the 'Calculate' or 'Orbit' button will display the escape count or orbit of the centre point.

Tapto get information about a point.
Dragto view orbits
Drag with two fingersto pan.
Pinchto zoom.