Lavaurs algorithm
2 minutes read | 280 words by Ruben BerenguelThese days I’ve been busy programming a version of Lavaurs algorithm for the idenfication of circle chords: the abstract Mandelbrot set.
The images don’t look like much, but the output of the program is nicer: it
outputs an Encapsulated PostScript file which looks sharper. But when converting
to png
with ImageMagick some distortion appeared.
You can get the black and white depth 13 PostScript file here here, and the color version here.
Note from 2019: I had to dig quite a bit to locate these two files!
The code is a set of Lisp functions, with the main one being recursive. I also have a double-recursive version, but the first time I used it I thought I had a problem with the code, and rewrote it. It did work, but it is slower. The output is a set of orthogonal circles to a main one, set as “clip” in the PostScript file.
Note from 2019:A few months after I wrote this post and code, Adam Majewski rewrote big chunks of my Lisp code (with my blessing), making it faster and cleaner. You can read about it, and about the Lavaurs algorithm in this wikibook. Nowadays you can find many implementations of Lavaurs chords, back when I wrote mine I think it was the only one freely/easily available. I have recovered my original code (unmodified, for my modern shame), you can find it in this gist.
I am increasingly happier of my last Christmas postcard & tutorial, as they forced me to learn PostScript programming. Turns out to be more useful than I thought.