Mandelbrot Set Explorer
The most famous fractal in mathematics. Pan and zoom through the complex plane, adjust the initial condition z₀, change palettes, and enable animation to watch the boundary between escape and stability shift in real time with smooth coloring.
The Mathematics
The Mandelbrot set is the set of complex numbers c for which the iteration z_{n+1} = z_n² + c, starting from z₀ = 0, remains bounded (never escapes to infinity). Points inside the set are colored black; points outside are colored by how quickly they escape — producing the iconic fractal boundary.
Real / imaginary component form x_{n+1} = x_n² − y_n² + c_x
y_{n+1} = 2·x_n·y_n + c_y
Escape criterion If |z_n|² = x_n² + y_n² > 4, then c is outside the set (escapes to infinity)
Smooth coloring (eliminates banding) ν = n + 1 − log₂(log(|z_n|)) continuous escape value
This interactive implements the full Mandelbrot iteration on an HTML5 canvas. Each pixel maps to a complex coordinate c, the iteration runs up to maxIter times, and the smooth coloring algorithm ν = n + 1 − log₂(log|z|) produces continuous color gradients without discrete bands. The animation mode gently oscillates z₀ to morph the set's boundary in real time.
Interactive
Drag to pan · Scroll to zoom · Adjust iterations, z₀ offsets, color cycle, and palette · Enable animation.
Learning Objectives
- Define the Mandelbrot set as the set of c-values for which z² + c stays bounded from z₀ = 0
- Explain the escape criterion |z| > 2 and how iteration count maps to color
- Navigate the complex plane by panning and zooming to discover self-similar boundary structure
- Observe how adjusting z₀ away from 0 transforms the set (connecting to Julia sets)
Teacher Notes
- Start with default settings — the full set is visible at zoom 2.8 centered at −0.5
- Zoom into the boundary to find mini-Mandelbrots (self-similar copies of the whole)
- Increasing max iterations reveals more detail at high zoom levels
- Enable animation to show z₀ oscillation — connect this to how Julia sets emerge from the Mandelbrot boundary
- Three palettes: Neon, Cosmic Purple, Fire Thermal — pure aesthetics, same math