Mandlebrot set
- Planted:
I’m working through the O’Reilly Programming Rust book, which covers a multi-threaded implementation of the Mandlebrot set.
My code—really, the book’s code—is here: pmillspaugh/mandelbrot
. It produces a two-dimensional image like this one:
Mandelbrot set
Per Wikipedia:
The Mandelbrot set is a two-dimensional set with a relatively simple definition that exhibits great complexity, especially as it is magnified. It is popular for its aesthetic appeal and fractal structures. The set is defined in the complex plane as the complex numbers
c
for which the functionfc(z) = z2 + c
does not diverge to infinity when iterated starting atz = 0
.
3Blue1Brown's Mandelbrot video explains this well in less than 2 minutes.
Complex numbers
I had to look up what a complex number is. It's a number of the form a + bi
where a
is a real number and and bi
is an imaginary number.
I also had to look up what an imaginary number is: b
is the coefficient, and i
is the imaginary unit, defined as the square root of -1.
Fractals
The Mandelbrot definition also mentions fractals, which are geometric patterns that repeat themselves at infinite depth.
Really cool visuals
Complex numbers and fractals bend my mind a little, and I'd like to spend more time later reading about real world uses, but in the meantime I can enjoy the beautiful visualizations they produce. See, for example, zooming into the boundary of the Mandelbrot set from its Wikipedia page.