Project that I did in my studies at 42Berlin, It's about exploring the beauty of fractals, more specifically the Mandelbrot and Julia sets.
The term fractal was first used by mathematician Benoit Mandelbrot in 1974. He based it on the Latin word fractus which means "broken" or "fractured". A fractal is an abstract mathematical object, like a curve or a surface, which pattern remains the same at every scale. Various natural phenomena – like the romanesco cabbage – have some fractal features.
Create a basic computer graphics project.
You are going to use the 42school graphical library: the MiniLibX! This library was developed internally and includes basic necessary tools to open a window, create images and deal with keyboard and mouse events.
More about MiniLibX: https://harm-smits.github.io/42docs/
This will be the opportunity for you to get familiar with the MiniLibX, to discover or use the mathematical notion of complex numbers, to take a peek at the concept of optimization in computer graphics and practice event handling.
(tested on Ubuntu)
git clone https://github.com/VulpesDev/Fractals-Explorer.git ~/Fractol
cd ~/Fractol && make && ./fractol m
Different parameters to use
./fractol m
./fractol j
./fractol j r<0-500> i<0-500>
(for example: "./fractol j r450 i210)
./fractol t
At first it was really hard to imagine how fractals should be rendered overall. What I end up doing in the beginning was creating a line drawing function (Bresenham's line algorithm), this turned out to be useless for the project so I deleted it and started it over. Then I found it difficult to translate complex number calculations (we were not allowed to use the complex.h), but in the end the project turned out to be quite simple and took me 3-4 days to finish.