This project has the goal of creating a program with a graphical library (minilibx), by creating, handling and refreshing the image.
Important:
To run the program you first need to install X11, XShm extension and libbsd-dev package, by typing in the terminal:
sudo apt-get install gcc make xorg libxext-dev libbsd-dev
After that, enter the folder mlx_linux and run ./configure
*This program is built to run on Linux and most of the utilities in MacOs will fail since the int sent by each key has a different value.*
In the mandatory part, the task given is to have a program that would be able to:
- Offer the option of the chosing both Mandelbot and Julia sets.
- Offer the option to zoom on mouse wheel.
- Be able to exit the program by pressing ESC or by clicking in the cross(x) in the window.
So the way i aproached the problem is let the user choose by typing:
1 - $> ./fractol mandelbrot
2 - $> ./fractol julia
3 - $>./fractol julia (double x) (double y)
4 - $> ./fractol hourglass (a mathematical incorrect yet beautifull fractal I've created.)
Results:
The first image shows the Mandelbrot set with 300 iterations. The second one, The Julia set with c = -0.78i with 300 iterations, and the third image is deep inside one Julia set choosed by the mouse click, once again with 300 iterations.
Some extra features I added:
- Ability to move the image with W A S D or the arrow keys. (increases the speed with the zoom).
- Increase or decrease the iterations with the '+' and '-' keys on the numpad.
- For the Mandelbrot set, choose where to zoom by mouse clicking the spot in the image (once). For the Julia set, change the c parameter by mouse clicking the new values. (The new value will be displayed on the terminal).
- A night mode by pressing 'N'.(and rechange to normal mode by re-pressing it).
I could go into details what's the mathematics behind each set but nowadays you can find it almost everywhere. If you have literally zero insights, I would however recomend you the numberphile videos (since i really enjoy them and probably you will understand at least the concepts),
There is of course some points in the job that could be better. The first great feature that i can think of is a scalable with zoom axis, to really be able to get a more mathematical aproach on this program.
The second thing that i can think of is to really be able to zoom where the mouse stands, that would have been great however i couldn't understand how to do so on minilibx library.
As my grade i got 125, getting full grade on the mandatory and the bonus part. (Thanks to a strong defense the knohow of my collegues on how hard it is to do some of the steps with just mlx library).