Fractal

Apollonian Gasket

A circle packing that zooms forever.

You're looking at a fractal made of circles. Each remaining gap is filled with another circle, and that process never stops. The classical construction is Descartes' Circle Theorem: given three mutually tangent circles, there are exactly two circles tangent to all three. Recurse, and the leftover space fills with infinitely many circles.

k4 = k1 + k2 + k3 ± 2√(k1k2 + k2k3 + k3k1)

Curvature k = ±1/r

This page takes a slightly different route. Every circle here holds a ring of six children plus one in the centre, all scaled by exactly 1/3. That single ratio is the self-similarity fixed point of the generator. Zoom in by 3× and the picture you get is congruent to the one you left, so the zoom can wrap without a seam.

The renderer ramps scale from 1 to 3 over sixteen seconds, then wraps. A slow whole-field rotation rides on top. At each wrap it unwinds exactly one generation of the spiral twist baked into the geometry, so the motion stays continuous.

Circles are generated on the CPU, then drawn as line segments through a WebGL2 shader. The shader also does a little cursor parallax: the centre stays put, the outer rings drift toward the pointer, deeper generations more so. If WebGL2 isn't available, a static Canvas 2D frame is drawn instead. prefers-reduced-motion holds a still frame.