Spiralyst Lab logo Spiralyst Lab ← All fractals 2D · spin

2D fractal

Apollonian gasket

Live turntable captured from Spiralyst Lab.

The Apollonian gasket packs circles against circles, filling every gap between three touching circles with the largest circle that fits and then filling the new gaps forever. Governed exactly by Descartes' Circle Theorem, it becomes a jewel-like foam of circles spanning every scale.

A Foam of Perfect Circles

The Apollonian gasket is a packing of circles in which every gap between three mutually touching circles is filled by the unique largest circle that fits, and then the three new gaps that creates are filled again, and again, without end. It is named for Apollonius of Perga (c. 200 BC), who posed the problem of finding a circle tangent to three given circles, though the infinite recursive packing came much later.

What makes the gasket more than a pretty picture is that it is governed by exact arithmetic. Descartes' Circle Theorem relates the curvatures (the reciprocals of the radii) of any four mutually tangent circles in a single quadratic equation, so given three tangent circles you can solve directly for the fourth. The whole infinite figure can therefore be generated by nothing but algebra. The gasket is a true fractal: between any two of its circles there are infinitely many more, and it has a fractal (Hausdorff) dimension of about 1.3057 — more than a curve, less than a filled area.

There is even a small miracle of number theory hiding in it: if the starting circles have whole-number curvatures, then every single circle in the entire infinite gasket has an integer curvature too.

(k₁+k₂+k₃+k₄)² = 2·(k₁²+k₂²+k₃²+k₄²)

Descartes' Circle Theorem, with k = curvature = 1/radius. A circle tangent to three others must satisfy this — the engine that lets the gasket be built from arithmetic alone.

k₄ = k₁ + k₂ + k₃ ± 2·√(k₁k₂ + k₂k₃ + k₃k₁)

Solving the theorem for the fourth curvature. The two solutions are the small circle that fills the inner gap and the large circle that encloses the other three.

fractal dimension ≈ 1.3057

The Hausdorff dimension of the gasket — a precise measure of how thoroughly the ever-smaller circles fill the plane.

In Spiralyst Lab

Spiralyst Lab seeds three equal circles inside an outer bounding circle (its curvature taken negative, since it encloses the others), then uses the complex form of Descartes' theorem to solve for each new tangent circle and recurses into the gaps to a chosen depth. A 'wobble' control can perturb the seed for an artistic warp. Circles are stroked through the palette so size maps to colour; spin it slowly with glow for a dense, jewel-like foam.

Every parameter below is a live control — set it by hand, map it to a frequency band, or let it ride a smooth animation. These ranges are the actual in-app slider limits.

ParameterRange (in-app)
Outer radius0.4 – 0.98
Recursion depth3 – 9
Wobble-0.6 – 0.6

Audio-reactive by default: depth 3→9, wobble -0.6→0.6. Any control can be mapped to audio or animation.

Plus the universal 2D controls every spiral type shares: density & stroke, rotation, squash, jitter, zoom & pan, glow, trails, vignette, and multi-layer stacking (count, hue offset, opacity).

Apollonian gasket still 1 Apollonian gasket still 2 Apollonian gasket still 3

Watch it in action

Full-length showcase video — coming soon
assets/video/fractals/12-apollonian-gasket.mp4

Did you know: If the curvatures of the starting circles are integers, every circle in the whole infinite gasket has an integer curvature — a fact that connects this picture to deep questions in number theory.

Get Spiralyst Lab — $24.99/yr ← Back to the gallery