Most people have heard of the Mandelbrot set or the Julia set, but few know that Isaac Newton also created, for an entirely different purpose - an algorithm which generates similar hallucinogenic patterns.

This recursive method appears early in his treatise called The Method of Fluxions & Infinite Series ( completed by 1671 but published in 1736), a great milestone in the history of calculus. The method essentially uses a kind of feedback loop to use the output of an equation as its next input, to get closer and closer to the desired value ( a root of the equation) .

The Wikipedia hints at the connection to its chaotic nature: “It is relevant to numerical analysis because it shows that the Newton method can be very sensitive to its choice of starting point.”

How To Make The Animations

These instructions are for Linux computers but if you know how to compile a C program in Windows, you should be fine.

First, download the program.

Now, inside the same directory type the following command into the terminal: $ gcc newton.c -o newton -lm

Your code should have compiled without any problems or messages. Now execute the program using examples given here like so: $ ./newton -o simple.bmp -s 640x512 -x 0.4 -X 1.05 -Y 1.05 -c 1,0,0:1,1,0:0,0.7,0:0,0.5,1 – -1 +1 -i +i

The .bmp file is now in that directory. You can play around with the variables and maybe try manipulating the colors using Gimp or Photoshop. Generate several frames and place them all into a new directory here, lets call it “fractal”.

Normally all linux distros will have ImageMagick. If yours does not, you need to install that first. Generate the animated gif with the following command: $ convert -delay 10 fractal/*.bmp -loop 0 animation.gif

Enjoy playing with the software and share your animations on the internet!

References:

This exercise was created as a part of our ongoing workshop. Registrations are always open.

