Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

README

        





Logo


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
### Requirements

The 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)