!header Newton’s Method, Extended !begin-text-block Newton’s method is a famous algorithm for finding roots of functions. As explained in that applet, points are colored based on what root they eventually converge to. Since the only functions allowed in that one are polynomials, the roots are known ahead of time, and the colors are predetermined too. This applet aims to draw Newton’s method fractals for any elementary function, not just a polynomial. There are a number of challenges with this, chief among them making a palette for a large and potentially infinite number of roots. There’s also the issue of knowing when the algorithm is near a root without knowing where those roots are ahead of time, and making sure that different points that converge to the same root always get the same color, again without knowing what they’re converging to. But all these problems turned out to be solvable — even the palette generation part, which was my first time working with color science. It turned out better than expected! The derivative precision determines the accuracy with which the applet computes the derivatives it needs to apply the algorithm. Lower values will result in images with deeper possible zooms and less noise at the cost of mild distortion, while higher values give more accurate images, but usually with shallower possible zooms and slight noise. The syntax is the same as in the generalized Julia sets applet. Below are some examples to get started — see what you can come up with! !wilson !end-text-block

Classic polynomial: csub(cpow(z, 6.0), 1.0)

Trig function: csin(z)

Crosshatch: cmul(csin(z), csin(cmul(z, i)))

Palette demonstration: cmul(sin(z), csin(cmul(z, i)))

Butterflies: cmul(sin(z), tan(z))

Generating Function

!begin-text-boxes resolution 500 Resolution derivative-precision 20 Derivative Precision !end-text-boxes !begin-text-buttons generate l Generate randomize-palette l Regenerate Palette !end-text-buttons
!begin-text-buttons download l Download !end-text-buttons