This project is about creating a simple computer graphics program to show the beauty of fractals.
A fractal is an abstract mathematical object, like a curve or a surface, which pattern remains the same at every scale.
To understand what fractals are all about, we need to take a step back and dive a little bit into the world of complex numbers.
Let's consider a point A and a constant c in the complex plane, as well as the generic function A and iteratively apply the same function to its result, again and again, for let's say about 100 iterations.
It's very interesting to see that for some values of c the iteration converges, while for others it diverges to infinity at different speed. In the following example, A is set to 0.4 + 0.4i.
julia_set.mov
When iterated from A = 0, the set of complex numbers c for which the function
On the other hand, for a given complex number c, the Julia set of c is the set of all A for which the iteration
Particularly interesting to see are the boundaries of the different Julia sets for a given value of c, i.e. the perimiter in the complex plane outside which the iterations diverges to infinity.
julia_set_boundaries.mov
Within the scope of this project, it was required to display the Mandelbrot set as well as any possible Julia set, given a different value of the constant c as input.
To run the algorithm, it is first needed to clone the repository, move the its directory and then execute the Makefile.
git clone https://github.com/andreabertolini1995/fract-ol.git
cd fract_ol
make
Then, you can launch the executable followed by the name of the fractal you want to display. With the mouse wheel you will be able to zoom in and out almost infinitely (within the limits of the computer).
./fractol mandelbrot
mandelbrot.mp4
For the Julia set, it is required to specify the complex coordinates of the constant c.
./fractol julia 0.285 0.01
