42 Yerevan Fractol
For further information about 42cursus and its projects, please refer to 42cursus repo.
One of the first graphical projects at 42 School, fract-ol generates beautiful fractals from the complex numbers of
an iterative mathematical construct. A fractal is a fragmented geometrical figure that infinitely repeats itself at
smaller scales. This project uses the school's graphical library, MiniLibX.
For detailed information, refer to the subject of this project.
🚀 TLDR: The fract-ol project is one of the three "beginner" graphical projects of the
cursus. It teaches you about using graphic library, advanced math, and more.
Note
Because of 42 School norm requirements:
- Each function can't have more than 25 lines of code.
- All variables are declared and aligned at the top of each function.
- Project should be created just with allowed functions otherwise it's cheating.
The program supports these fractal sets:
Name | Formula |
---|---|
Mandelbrot | |
Julia | |
Burning Ship | |
Tricorn | |
Mandelbox | It's more complex, see this article |
Celtic Mandelbar |
The program supports the following controls:
Key | Description |
---|---|
ESC | Close the program window |
Keys [1-6] | Move to another fractal |
Keys [Q-Y] | Change the color of fractal |
Keys [A-H] | Change the color of fractal |
Mouse Scroll | Zoom in and out of the fractal |
⬆️ ⬇️ ⬅️ ➡️ | Change the viewpoint |
Key L | Lock Julia's fractal |
Zero | Reset the fractal to its initial state |
The program is written in C language and thus needs the gcc compiler and some standard C libraries to run.
1. Compiling the program
To compile the program, run:
$ cd path/to/fractol && make
2. How to run the program
Run the executable too see the help message:
./fractol
Or run with some supported fractal:
./fractol mandelbrot