Classic Fractals
Sierpinski Triangle
Chaos-game point iteration converging to the Sierpinski gasket.
sierpinski/sierpinski.cpp
Sierpinski Carpet
Recursive 9-subdivision with center square removed at each level.
sierpinski/sierpinskiCarpet.cpp
Koch Snowflake
Each line segment replaced by 4 segments forming an equilateral bump.
kochsnow/kochsnowByEasyX.cpp
Cantor Set
Remove the middle third of each segment, recursively.
cantor/cantor.cpp
Arborescent Tree
Recursive branching tree with brown-to-green gradient and random jitter.
arboresent/arboresent/arboresent.cpp
Rainbow
HSL color gradient background with concentric rainbow arcs.
rainbow/rainbow.cpp
Starfield
Animated star particles scrolling with variable speeds.
stars/stars.cpp
New Fractals
Mandelbrot Set
Escape-time algorithm with 256-iteration rainbow palette.
mandelbrot/mandelbrot.cpp
Interactive Mandelbrot
Click to zoom 3x, press R to reset, Q to quit.
mandelbrot/interactive.cpp
Barnsley Fern
4 weighted affine transforms iterated 200,000 times.
fern/fern.cpp
Dragon Curve
Paper-folding fractal built by recursive turn sequence.
dragon/dragon.cpp
Hilbert Curve
Order-N space-filling curve with rainbow coloring.
hilbert/hilbert.cpp
L-System Interpreter
General L-system engine with turtle graphics. Demos: Koch, Dragon, Plant.
lsystem/demo.cpp
Build
brew install sdl2 # macOS cmake -B build -S . cmake --build build ctest --test-dir build # run unit tests