Skip to content
Adrien Hubert

Newton's basins of attraction.

A polynomial with three roots, three colors, one rule. Every pixel in the complex plane starts a Newton iteration. It is painted by which root catches it and how fast. The boundaries between the three regions are not curves. Zoom in anywhere and the same three colors keep nesting forever.

Render
30
1.80

What you are seeing

The frame is a window into the complex plane, real on the horizontal axis, imaginary on the vertical. The three small circles are the roots of a cubic polynomial — drag them. For every pixel, the code takes that point as a starting guess and runs Newton's iteration on the polynomial. The iteration walks toward one of the three roots. The pixel takes that root's color, dimmed by how many steps it took to get there. Slow convergence reads dark; immediate convergence reads bright. The dark filaments are not noise — they are the points whose iteration spent the longest arguing about which basin to fall into.

The math

Given three roots r₁, r₂, r₃, the polynomial is p(z) = (z − r₁)(z − r₂)(z − r₃). Newton's step is z ← z − p(z) / p'(z), which the renderer computes through the logarithmic-derivative identity p'/p = Σ 1/(z − rₖ), so the per-pixel inner loop is three complex reciprocals, a sum and a single division. Convergence stops as soon as the iterate lands within 10⁻³ of any root, or after the iteration budget runs out. The starting guess for each pixel is its own complex coordinate, which is why the output is a map of "where does Newton's method send you from here."

Things to try

Drag two of the roots almost on top of each other. The third basin grows a thin neck between them and the fractal boundary turns vicious. Pull one root far out of frame. Its color fills more of the plane than feels fair, because the basin around an isolated root is large. Tighten the view half-width all the way down. The same three colors nest at every depth, because Newton's boundary has the Wada property: every point on it touches all three regions.

Source

The picture goes back to John Hubbard's early-1980s study of the global dynamics of Newton's method on complex polynomials, later distilled in Hubbard, Schleicher and Sutherland, How to find all roots of complex polynomials by Newton's method, Inventiones Mathematicae 146, 2001. The famous black filaments on the basin boundary are the Julia set of the Newton map of p.