This project has been created as part of the 42 curriculum by kraksana.
A graphical fractal explorer written in C using MLX42, developed as part of the 42 Bangkok curriculum.
The goal of this project is to render and explore mathematical fractals while learning graphics programming, complex numbers, event handling, and pixel-based rendering in C.
The implementation supports:
- Mandelbrot set
- Julia sets with custom parameters
- Mouse-wheel zoom in and out
- Multiple colors based on iteration depth
- ESC and window-close handling
- Image rendering with MLX42
This repository contains the mandatory part of the project.
- Complex numbers
- Mandelbrot and Julia sets
- Pixel-to-coordinate mapping
- Iterative fractal calculations
- Color generation
- Graphics with MLX42
- Mouse and keyboard events
- Image buffers
- Argument parsing
- Makefiles
- 42 Norm coding standard
Install the required dependencies on macOS:
brew install cmake glfwClone MLX42 into the project root:
git clone https://github.com/codam-coding-college/MLX42.git MLX42Compile the project:
makeMandelbrot:
./fractol MandelbrotJulia:
./fractol Julia -0.7 0.27015Another Julia example:
./fractol Julia 0.285 0.01- Mouse wheel up — zoom in
- Mouse wheel down — zoom out
ESC— close the program- Window close button — close the program
make
make clean
make fclean
make re- Supports Mandelbrot and Julia sets
- Supports custom Julia parameters
- Uses MLX42 image rendering
- Builds with
-Wall -Wextra -Werror - Passes Norminette
- Mandatory part completed
Kullatida Raksanaves 42 Bangkok