Newton's method is an numerical method for finding roots (zeros) of a function. For a function \(f(z)\) and some starting point \(z_0\), we iteratively apply the following recurrence relation:
This process brings the point closer to \(f(z) = 0\).
Each pixel on the screen represents a \(z_0\) point in the complex plane. We apply Newton's method to each point and color it based on which root it converges to, or black if it doesn't converge. The trail indicates the path of a point starting from the mouse cursor as it undergoes this process. Notice the chaotic behavior near the boundaries of colors.
The polynomial \(f(z)\) being visualized is in the form:
Where \(r_1\), \(r_2\), etc. are the roots represented by draggable circles. You can add, remove, and drag roots to change the polynomial and see how the fractal changes in real-time.
In standard mode, we fix a polynomial \(f(z) = (z-r_1)(z-r_2)...(z-r_n)\) and for each pixel \(z_0\) in the complex plane, we run Newton's method to see which root it converges to. We are fixing a function and each pixel corresponds to a starting point, like julia sets.
In Mandelbrot mode, each pixel \(r_p\) becomes a new root of the polynomial. For each pixel:
Here, each pixel determines the function we're working with, and the starting point is fixed, like the mandelbrot set. In fact, if you reduce the number of roots to 2, you can get the mandelbrot set to appear by looking for black pixels.
This visualization was inspired by 3Blue1Brown's great video on Newton's Fractal: