Home▸Mathematics▸Newton Fractal 2D — Basins of Attraction

Newton Fractal 2D — Basins of Attraction

Canvas2D Newton's method fractal: every pixel iterates z ← z − a·f(z)/f′(z) in the complex plane and is coloured by the root it converges to. Switch polynomials, tune relaxation and iterations, then click or scroll to zoom into the boundary.

Mathematics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-newton-fractal ↗ Open standalone

This 2D companion runs the same Newton's-method iteration as the 3D GPU-shader version, but on the CPU with a plain Canvas2D pixel buffer: pick z³−1, z⁴−1, z⁵−1, a custom zⁿ−1, or the chaotic z³−2z+2, then watch the basin-of-attraction map render row by row as each pixel's root and convergence speed are computed.

⚙ Under the hood

Per-pixel complex Newton iteration z ← z − a·f(z)/f′(z), rendered progressively into an ImageData buffer; colour = which root, brightness = how fast it got there.

newton's methodbasins of attractioncomplex rootsfractal boundaryroots of unity

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)