Julia settee
I’ve written this, so I might as well share it.
In my post on the Mandelbrot set earlier, I mentioned the Julia sets of the quadratic polynomial fc(z) = z2 + c where c is a given (constant) complex number and z are the points of the complex plane. Because I wanted to visualise how those Julia sets changed as c varied, I’ve written a short program to do that for me.
You can find it here. As usual, you’ll need Allegro, and the compilation instruction is on the first line.
What it does is take two complex numbers as parameters, plus the number of steps it should take to go from the first to the second. At each step, it will calculate and display the Julia set of the quadratic polynomial with that complex number as c, and hopefully your computer is fast enough that the successive Julia sets look like an animation.
For example, if you invoke it as:
./julia -0.8 -1 -0.8 1 200
you’ll see the following:

Though probably not at the same speed. I’ve made no effort to maintain a certain frame rate; the whole thing moves as quickly as your CPU can keep up, because I just wanted a visualisation of how Julia sets change, not a screensaver. If it’s moving too slowly for you, you can try reducing the number of steps, or lowering the numbers in the ZOOM or ITERS #defines, though the first one will make the image smaller and the second will make it darker. If you aren’t interested in the window title, you can also remove the snprintf and set_window_title steps for a significant speed-up.
If it’s too fast, you can do the reverse, or you can build in a delay with Allegro’s install_timer and rest, or POSIX’s usleep or nanosleep.
(Once it’s done, it will just pause at the last Julia set. Press any key to close it. If you want to close it before it’s done, you’ll have to kill it manually.)
The interesting points to explore are the ones inside the Mandelbrot set, as anything else will just be Fatou dust (though you’ll probably still be able to see it because of the grey). For those points, the salient area is the one within 2 unit lengths of the origin, which is why the field displayed ranges from (-2, 2) in the top left corner to (2, -2) in the bottom right (or probably (-2, -2) to (2, 2), I don’t remember). If you need a bigger plane, replace all instances of ZOOM * 4 with ZOOM * (bigger number), and all instances of ZOOM * 2 with ZOOM * (half of bigger number) (if you want to keep the origin in the center of the window).
If you actually want to save the animations, man 3alleg save_bitmap and assemble the images yourself in something like the GIMP. I initially started out doing it this way, but animated GIFs get really big really quickly, so I went with this instead.
Enjoy.


















Once Upon A Number: The Hidden Mathematical Logic of Stories talks about the relation between statistics and storytelling, in a rather loose sense. He discusses the difference between information and meaning, and how logic and language hang together.
A Mathematician Plays the Market (one edition is titled “A Mathematician Plays the Stock Market”, for some reason) is a completely different book. It describes Paulos’ real-life experience with the stock market, and how he lost a significant sum of money in the
Imagining Numbers (Particularly the Square Root of Minus Fifteen), by Barry Mazur, is about the history and mathematics of imaginary numbers, and how mathematical imagination lines up with the more classic, “poetic” imagination.
Innumeracy, by John Allen Paulos, is about (surprisingly) innumeracy, or mathematical illiteracy. Distinct from the more pathological dyscalcia, it instead implies something closer to functional analphabetism: an inability to grasp simple mathematical concepts, not because one isn’t smart enough or the concepts are too arcane, but simply because whatever mathematical skills the person once might have had have eroded from lack of use.
This book took far longer to finish than it should have. This is in large part due to the silly conclusion Penrose tries to reach, which just makes my brain bleed.
I read too quickly. The Nothing That Is, by Robert Kaplan, is about the history of zero.
I managed to finish a book before buying new ones!


