Overview
fractol is an interactive fractal renderer focused on drawing mathematical sets in real time and exploring them through zooming, panning, and color variation.
Visit the repository for source and setup instructions.
Usage
Build with make, then run the program with one of the supported forms:
make
./fractol mandelbrot
./fractol julia -0.4 0.6
./fractol julia 0.285 0.01
./fractol julia -0.8 0.156
Use the mouse wheel to zoom and Esc or the window close button to exit.
What I Built
- Rendered Mandelbrot and Julia sets using complex-number iteration.
- Parsed Julia constants from the command line and validated numeric input.
- Added mouse-wheel zoom and event-driven redraws through MiniLibX/X11 hooks.
- Mapped screen coordinates into the complex plane and updated the view interactively.
Details
Mapping pixels to math
Each pixel is mapped into the complex plane, iterated through the selected
fractal formula, and colored according to how quickly it escapes. Zooming and
panning update that mapping so the same renderer can explore different areas.
The renderer uses z = z^2 + c, with Mandelbrot using the pixel position as
the constant and Julia using command-line constants.
Rendering loop
The project redraws a 1200x1200 image buffer and writes pixels directly before
putting the image into the window. It links MiniLibX with X11/Xext and libm,
and uses a small ft_printf library for formatted output.
Notes
The project is a compact mix of math, graphics, and low-level rendering. It is especially useful for showing pixel-level drawing, event handling, and performance-conscious loops in C.