IFS Fractals (2D) — Chaos Game Attractor Plotter
A Canvas2D chaos-game plotter for Iterated Function Systems: pick a preset — Barnsley fern, Sierpinski triangle, Dragon curve, Lévy C, binary tree or coral — and watch its fractal attractor emerge point by point from randomly-applied contractive affine maps.
This 2D companion runs the same chaos-game algorithm as the 3D version — repeatedly applying a randomly chosen contractive affine map to a running point — but plots it directly on a Canvas2D surface instead of splatting into a WebGL render target, fading old pixels toward the background colour each frame instead of blending through a fragment shader.
Canvas2D chaos-game plotter for Iterated Function Systems: six presets (Barnsley fern, Sierpinski, Dragon curve, Lévy C, binary tree, coral), each a small set of contractive affine maps applied at random with fixed probabilities.
2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install
Frequently Asked Questions
What is the chaos game?
Starting from an arbitrary point, the chaos game repeatedly picks one of a small set of contractive affine maps at random, weighted by its probability, and applies it to the current point. Plotting every resulting point gradually reveals the IFS attractor — a fractal shape that does not depend on where you started.
Why does the canvas fade instead of clearing?
Each frame blends the previous pixels slightly toward the background colour before plotting new points, so recently-plotted regions stay bright while older ones dim out. This keeps the attractor visible as a dense, glowing cloud instead of an ever-growing static image.