Julia sets — how one point changes the fractal
The same rule can draw very different patterns. Pick a point on the Mandelbrot map to set c. Then follow the rule z ← z² + c from every starting point in the second image.
Pick a parameter on the map
Click, tap, or drag on the Mandelbrot map. You can also choose a preset or move the marker with the arrow keys. Hold Shift for smaller steps.
Mandelbrot map
Julia pattern
c = (-0.123; 0.745)The orbit of zero did not escape in 240 steps
Video walkthrough
What do the points in the two pictures mean?
Each point on the Mandelbrot map represents a different c. For every c, we start at z₀ = 0. If the values remain bounded, c belongs to the Mandelbrot set.
In the Julia image, all pixels share the same c. Each pixel supplies a different starting value z₀. The starting points with bounded orbits form the filled Julia set. Its boundary is the Julia set.
Start with a circle
Select “Circle”. When c = 0, each step squares z. Starting from ½ gives ¼ and then 1⁄16. Starting from 2 gives 4 and then 16. Inside the unit circle, the values converge to zero. Outside it, their distance from zero grows without bound. On the circle, that distance stays equal to one.
The disk together with its rim is the filled set for c = 0. The circle is its boundary. Switch to “Rabbit” and see how changing c changes the boundary.
What does the boundary on the map tell us?
Every c has its own Julia pattern. When c belongs to the Mandelbrot set, the corresponding Julia set is connected. Outside the Mandelbrot set, it breaks up into separate points.
Compare “Rabbit” and “Separate fragments”. The marker moves a short distance, yet the shape of the entire pattern changes. The line below the images shows whether the orbit starting at zero escaped within 240 steps.
How a pixel gets its colour
At every step, measure the distance from z to zero. Once that distance exceeds the radius R = max(2, |c|), subsequent distances grow and the orbit escapes to infinity.
The colour encodes the first step at which the orbit escapes. A dark pixel means no escape was detected within 240 steps. The step limit keeps rendering practical and gives an approximation of the boundary.
Test a single starting point
The function takes the real and imaginary parts of z₀ and c. It returns the first escape step or 0 if no escape was found within the budget. For example, juliaEscapeStep(2, 0, 0, 0) returns 1.
An image of width W and height H with a step limit L takes up to O(W × H × L) operations. One orbit uses a constant number of values. The image and colour palette use O(W × H + L) memory.
Show executable code
function juliaEscapeStep(zr, zi, cr, ci, limit = 240) {
const radiusSquared = Math.max(2, Math.hypot(cr, ci)) ** 2;
for (let step = 1; step <= limit; step++) {
const nextReal = zr * zr - zi * zi + cr;
zi = 2 * zr * zi + ci;
zr = nextReal;
if (zr * zr + zi * zi > radiusSquared) return step;
}
return 0;
}