Apollonian Gasket Generator

Infinite fractal circle packing via Descartes’ theorem — every gap between three tangent circles is filled by the unique Soddy circle, forever.

◎ Descartes’ Theorem

Four mutually tangent circles with curvatures k₁–k₄ satisfy (k₁+k₂+k₃+k₄)² = 2(k₁²+k₂²+k₃²+k₄²). This 1643 result (rediscovered by Soddy in verse, 1936) drives the entire gasket construction.

∞ Fractal Dimension

The Apollonian gasket has Hausdorff dimension ≈ 1.3057 — strictly between a curve (1) and a filled region (2). The circles pack the outer disc asymptotically perfectly, but the residual set is an uncountable Cantor-like fracture.

ℤ Integer Curvatures

Starting from integer curvatures (like −1, 2, 2, 3), every circle in the gasket also has integer curvature. This deep arithmetic fact connects the gasket to quadratic forms, Apollonian group orbits, and prime distribution in integer packings.

🔬 Connections

Apollonian gaskets appear in Ford circles (Farey sequences), Kleinian group limit sets, conformal mappings of the Riemann sphere, and Schottky groups in complex analysis — all different faces of the same inversive geometry.

The Apollonius Problem

Around 200 BC, Apollonius of Perga asked: given three circles, how many circles are tangent to all three? In general there are eight solutions (Apollonius circles). When the three original circles are themselves mutually tangent, two of the eight collapse to a single pair of Soddy circles — one fitting in the interior gap, one enclosing all three.

The Apollonian gasket is the fractal generated by starting with four mutually tangent circles, then filling every curvilinear triangular gap with the unique Soddy circle that fits, and repeating for ever. This simulator uses the starting packing with curvatures (−1, 2, 2, 3).

Descartes’ Circle Theorem

(k₁ + k₂ + k₃ + k₄)² = 2(k₁² + k₂² + k₃² + k₄²) where kᵢ = 1/rᵢ (curvature = reciprocal radius) and the enclosing circle has NEGATIVE curvature: k₀ = −1/R Given three curvatures k₁,k₂,k₃, the two Soddy curvatures are: k₄ = k₁+k₂+k₃ ± 2√(k₁k₂ + k₂k₃ + k₃k₁) Soddy's verse (1936): "To spy out the point / where circles kiss / Appears to need calculus / But simple it is…"

The inverse Descartes formula avoids square roots entirely once the initial four circles are known. Given the four circles (k₁,k₂,k₃,k₄), a fifth circle k₅ that is tangent to k₁,k₂,k₃ but on the other side from k₄ satisfies:

k₅ = 2(k₁+k₂+k₃) − k₄ (no square root needed!) For centres zᵢ = (xᵢ + iyᵢ) as complex numbers: k₅·z₅ = 2(k₁z₁ + k₂z₂ + k₃z₃) − k₄·z₄ This is the formula used in this simulator — O(1) arithmetic per new circle.

Integer Apollonian Packings

Curvature kRadius r = 1/kNotes
−11Outer enclosing circle
20.500Two initial inner circles (×2)
30.333Two Soddy circles of initial triple (×2)
60.167Next generation (×4)
110.091(×4)
140.071(×4)
150.067Central circle between all three inner circles (×1)
18–500<0.056Thousands of circles from recursion…

Every circle in this gasket has integer curvature. A spectacular theorem: the integers that appear as curvatures of circles in a bounded Apollonian packing (with integer root quadruple) contain almost all integers — every sufficiently large integer occurs, with at most finitely many exceptions (Bourgain–Kontorovich, 2014, resolving an old conjecture).

Fractal Structure

The Apollonian gasket is self-similar: every curvilinear triangle between three tangent circles contains a complete smaller copy of the gasket. It is also conformally invariant: any Möbius transformation (a map z ↦ (az+b)/(cz+d)) sends one Apollonian gasket to another. The group of Möbius symmetries of the gasket is an infinite Kleinian group, and the gasket is its limit set.

The Hausdorff dimension of the gasket is approximately 1.3057 (Boyd 1973, confirmed rigorously by Sullivan 1979 using ergodic theory for Kleinian groups). Almost all the area of the outer disc is covered by the circles: the residual set — the fractal “dust” between all the circles — has Lebesgue measure zero.

FAQ

What is an Apollonian gasket?

A fractal created by starting with three mutually tangent circles and repeatedly filling every curvilinear triangular gap with the unique Soddy circle that fits. Named after Apollonius of Perga (~200 BC); the modern gasket construction traces to Leibniz and Soddy (1936). This simulator starts from the quadruple (−1, 2, 2, 3).

What is Descartes’ Circle Theorem?

If four mutually tangent circles have curvatures k₁,k₂,k₃,k₄, then (k₁+k₂+k₃+k₄)² = 2(k₁²+k₂²+k₃²+k₄²). Given any three, the two Soddy circle curvatures are k₄ = k₁+k₂+k₃ ± 2√(k₁k₂+k₂k₃+k₃k₁). The inverse form k₄' = 2(k₁+k₂+k₃)−k₄ requires no square roots and powers the recursive generation in this simulation.

Why are all curvatures integers in this gasket?

Starting from the integer quadruple (−1,2,2,3), every new circle uses the inverse formula k_new = 2(k₁+k₂+k₃)−k_old. Since the right-hand side is an integer combination of integers, all generated curvatures remain integers. This arithmetic closure is a hallmark of Apollonian packings with integer root quadruples, and leads to deep connections with the Apollonian group and quadratic Diophantine equations.

What is the fractal dimension of an Apollonian gasket?

Approximately 1.3057 (Hausdorff dimension). The gasket sits between a 1D curve and a 2D area. Almost all area of the outer disc is covered by circles, but the uncovered "dust" (the true gasket) has measure zero and dimension ~1.306. This was computed numerically by Boyd (1973) and connected to spectral theory of Kleinian groups by Sullivan (1979).

Related Simulations & Articles