Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dpetrosy/42-fractol
42 School Fractol project: Fractal generator using MLX library.
https://github.com/dpetrosy/42-fractol
42 42-fractol 42cursus 42fractol 42projects 42school 42yerevan burning-ship c complex-numbers fract-ol fractal-rendering fractals fractol fractol-42 julia-set mandelbox mandelbrot mathematics minilibx
Last synced: 7 days ago
JSON representation
42 School Fractol project: Fractal generator using MLX library.
- Host: GitHub
- URL: https://github.com/dpetrosy/42-fractol
- Owner: dpetrosy
- License: mit
- Created: 2024-03-07T19:23:22.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-03-20T15:50:10.000Z (11 months ago)
- Last Synced: 2024-12-02T01:17:09.435Z (2 months ago)
- Topics: 42, 42-fractol, 42cursus, 42fractol, 42projects, 42school, 42yerevan, burning-ship, c, complex-numbers, fract-ol, fractal-rendering, fractals, fractol, fractol-42, julia-set, mandelbox, mandelbrot, mathematics, minilibx
- Language: C
- Homepage:
- Size: 5.03 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Fractol Project
42 Yerevan Fractol
For further information about 42cursus and its projects, please refer to 42cursus repo.
๐ About Project
ยท
๐ Fractals List
ยท
๐ฎ Controls
ยท
๐จโ๐ป Usage
ยท
๐ Screenshots
---
## ๐ About Project
> 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**](README_files/fractol_subject.pdf).
๐ 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.## ๐ Fractals List
The program supports these fractal sets:
| Name | Formula |
|:-----------------:|:--------------------------------------------------------------------------------------------------:|
| Mandelbrot | $z_{n+1} = z_n^2 + c, z_0 = 0$ |
| Julia | $z_{n+1} = z_n^2 + c, z_0 = c$ |
| Burning Ship | $z_{n+1} = abs(z_n^2) + c, z_0 = 0$ |
| Tricorn | $z_{n+1} = \frac{}{z_n}^2 + c, z_0 = 0$ |
| Mandelbox | It's more complex, see [this article](https://sites.google.com/site/mandelbox/what-is-a-mandelbox) |
| Celtic Mandelbar | $z_{n+1} = \frac{}{z_n}^2 + c, z_0 = c$ |## ๐ฎ Controls
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 |## ๐จโ๐ป Usage
### RequirementsThe program is written in C language and thus needs the **gcc compiler** and some standard **C libraries** to run.
### Instructions
**1. Compiling the program**
To compile the program, run:
```shell
$ cd path/to/fractol && make
```**2. How to run the program**
Run the executable too see the help message:
```shell
./fractol
```Or run with some supported fractal:
```shell
./fractol mandelbrot
```# ๐ Screenshots
## Mandelbrot set
![Fractal mono-colored Mandelbrot](README_files/screenshots/mandelbrot1.png)
![Fractal red blue and green striped Mandelbrot](README_files/screenshots/mandelbrot2.png)
![Fractal sun crest purple Mandelbrot](README_files/screenshots/mandelbrot3.png)## Julia set
![Fractal purple green and yellow Julia](README_files/screenshots/julia1.png)
![Fractal red swirl Julia](README_files/screenshots/julia2.png)
![Fractal blue snowflake Julia](README_files/screenshots/julia3.png)## Burning Ship set
![Fract-ol golden Burning Ship](README_files/screenshots/burning_ship.png)## Tricorn set
![Fract-ol purple Tricorn](README_files/screenshots/tricorn.png)## Mandelbox set
![Fract-ol brown tribal Mandelbox](README_files/screenshots/mandelbox.png)