This project renders various types of fractals including:
- Mandelbrot Set
- Julia Set
- Tricorn (Mandelbar) Set
Created as part of the 42 core curriculum, this program focuses on using a low-level graphic library and visualization of fractals.
I've created a beginner-friendly presentation to help you get started with MinilibX: MinilibX Beginner's Guide - Canvas
- Real-time fractal rendering
- Smooth zoom functionality (mouse wheel)
- Multiple color schemes
- Complex number visualization
- Adjustable iteration depth
- Mouse wheel: Zoom in/out
- Arrow keys: Pan view
- ESC: Exit program
- C/V: Cycle color schemes
- Space: Reset view
- Z/X: Modify fractal parameters
- Window size: 800x600
- Max iterations: 100
- Zoom range: 0.000001 - 30.0
- Smooth color transitions
- Memory-efficient calculations
# Install required packages
sudo apt-get install gcc make xorg libxext-dev libbsd-dev# Install XQuartz
brew install xquartz
# Reboot is required after XQuartz installationDependencies:
- MinilibX graphics library (included in project)
- Math library
- C compiler (cc)
- Make
- Clone the repository:
git clone https://github.com/hermeszi/fractol.git
cd fractol- Compile the program:
make*--------------42 Fractol---------------*
* Usage: ./fractol [-m | -j | -t] *
* Examples: *
* Mandelbrot: ./fractol -m *
* Julia Set : ./fractol -j 0.4 0.6 *
*---------------------------------------*
-m: Generate Mandelbrot set-j: Generate Julia set (requires real and imaginary parameters)-t: Generate Tricorn set
# Generate Mandelbrot set
./fractol -m
# Generate Julia set with specific parameters
./fractol -j 0.4 0.6
# Generate Tricorn set
./fractol -t./configure: Permission deniedSolution:
chmod +x ./mlx_linux/configureconfigure [error] : Can't find a suitable X11 include directory.Solution (Ubuntu/Debian systems):
sudo apt update
sudo apt install libx11-dev libxext-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev xorg-devVerify installation
ls /usr/include/X11/Xlib.h/usr/bin/ld: cannot find -lbsd: No such file or directorySolution:
sudo apt install libbsd-devPlanned enhancements include:
- Additional fractal types
- More color schemes
- Performance optimizations
If you'd like to help improve this project:
- Fork the repository
- Create your feature branch
- Commit your changes
- Push to the branch
- Open a Pull Request
This project is part of 42 School's curriculum. While the code is available for reference and educational purposes, please be mindful of academic integrity policies.
This project uses the MinilibX (MLX) library, a low-level graphic library, which is subject to its own rights and license terms. MLX was developed by Olivier Crouzet for 42 School. Visit MLX Repository for more information about the library's terms of use.
- myuen (42 Singapore)
- 42 School for the project framework
- MinilibX developers
- https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set