POST
Buddhabrot
I first saw a fractal image back in 1991. It was on my good old Amiga 500, connected to a TV, and the program I used was named Mandel after Benoît Mandelbrot (in fact, that program would draw only the Mandelbrot set).
Almost 20 years later, I stumbled upon Buddhabrot, a variation of the algorithm used to render the Mandelbrot set developed by Melinda Green in 1993.
I was so astonished by the beauty of that fractal, that I spent some days in studying the algorithm and implementing one myself. In fact, the above pic has been generated by my code.
How the two methods work
The Mandelbrot set is the set of all complex numbers $ c \in \mathbb{C} $ for which the sequence:
$ z_{0} = c $
$ z_{n+1} = z_{n}^{2} + c $
is not divergent (that is, the modulus of $ z_{n} $ does not increase indefinitely).
The classic Mandelbrot fractal
Once upon a time 😄 the Mandelbrot fractal was drawn like that:
- pixels on the screen are mapped to complex numbers using the x axis on screen as the Real axis and the y axis on screen as the Imaginary axis.
- paint in black all the pixels/points belonging to the Mandelbrot set;
- if a pixel/point does not belong to the $ M $ set, paint it in a color depending on how fast it escapes to infinity: in the above pic red means one iteration, green about ten iterations, and so on.
Disclaimer: a bunch of methods exist to color the Mandelbrot fractal; I just kept it simple to save space.
Buddhabrot
Buddhabrot is an alternative way to visualize the Mandelbrot fractal, using the following algorithm:
- pick a random complex number $ c \in \mathbb{C} $;
- iterate the sequence on $ c $;
- if the sequence is not divergent on $ c $, go back to 1.;
- if the sequence is not divergent on $ c $, increment by one the brightness of all the pixels touched by the sequence starting from $ c $.
After a few millions cycles, the figure that begins to show up, rotated by 90 degrees clockwise, reminds some images of Gautama Buddha (and Ganesh, a Hindu god).
🔗 Reference
- Code to generate some fractals (written by me) on Github
- Description of the Buddhabrot algorithm (Melinda Green)
📷 **Photo credits**
All the fractal images are generated using Processing and my code.
The other photos come from Pixabay.