Three mutually tangent circles, one formula
Given three circles that are pairwise tangent to each other, how many circles are tangent to all three? Apollonius of Perga asked this in the 3rd century BC and found there are generically two solutions - one nestled in the gap between the three, one enclosing all of them. Descartes revisited the problem in 1643 and found something the ancient geometers could not: a purely algebraic relationship between the four curvatures (the reciprocal of each circle's radius, k = 1/r) of four mutually tangent circles.
The Descartes Circle Theorem
For four mutually tangent circles with curvatures k1, k2, k3, k4 (a circle enclosing the others counts as negative curvature, since it curves the opposite way), Descartes' relation is:
(k1 + k2 + k3 + k4)² = 2·(k1² + k2² + k3² + k4²)
Solving this quadratic for the fourth curvature given the other three yields the practical construction formula used to grow the gasket one circle at a time:
k4 = k1 + k2 + k3 ± 2·√(k1·k2 + k2·k3 + k3·k1)
The ± is exactly the two Apollonius solutions - the small circle that fits snugly in the curved triangular gap between the three, and the large circle that would enclose all three. To fill a gasket you always take the + branch, the smaller circle nestling into the empty space.
Complex Descartes theorem: circles carry a position, not just a size
Curvature alone tells you the size of the new circle but not where its centre sits. Descartes' theorem has a complex-number extension discovered by Lagarias, Mallows and Wilks that tracks the centre directly: define the curvature-centre product z = k·(centre as a complex number) for each circle. Then z4 satisfies the same quadratic shape as the curvatures:
z4 = z1 + z2 + z3 ± 2·√(z1·z2 + z2·z3 + z3·z1)
Because this formula gives both the curvature and the exact centre of the new circle in one shot, it is what makes the gasket practical to render: no trigonometric solving of tangency conditions, just arithmetic on complex numbers, applied recursively to every new triple of mutually tangent circles that a new circle creates.
Building the gasket recursively
Start from three mutually tangent circles (or the degenerate case of two parallel lines and a circle, a curvature-0 configuration that also satisfies the theorem). Each new circle placed into a gap creates three new gaps - one against each pair of its neighbours - so the construction is a ternary recursion tree. At depth d there are roughly 3⁾ new circles, and their curvatures grow geometrically, which is why the gasket fills its bounding circle's interior with infinitely many, infinitesimally small circles: the empty space left over has measure zero in the limit.
Curvatures are often whole numbers
A striking fact: if you start with four mutually tangent circles whose curvatures are all integers (the simplest is 0, 0, 1, 1 for two parallel lines and two unit circles, or -1, 2, 2, 3 for a proper bounded gasket), then every circle generated by repeatedly applying the Descartes formula also has an integer curvature. This is because the update k4 = 2(k1+k2+k3) - k4_old (derivable from the two roots of the same quadratic sharing a sum) is purely additive once the square root is eliminated between the two solutions - no irrational numbers are ever introduced. These integer Apollonian gaskets connect to number theory: the set of all curvatures that appear turns out to depend only on which residues mod 24 the starting curvatures occupy.
Fractal dimension
The gasket is a fractal: zoom into any gap and you see the same recursive tangent-circle structure at every scale. Its Hausdorff dimension has been computed numerically to about 1.3057 - between a line (dimension 1) and a filled area (dimension 2), reflecting that the residual empty space, while infinitely subdivided, still has positive but sub-planar dimension.
Frequently asked questions
What does a negative curvature mean in the Descartes formula?
A circle that curves the 'wrong way' relative to the others - typically the large outer circle that encloses the whole gasket. By convention its curvature is written as negative (k = -1/r) so the same additive formula k4 = k1+k2+k3 ± 2√(...) works whether the fourth circle is a small inner one or the large bounding one.
Why do Apollonian gaskets often have integer curvatures?
Because once you know three mutually tangent circles' curvatures, the two possible fourth curvatures (inner and outer solutions of the same quadratic) sum to 2(k1+k2+k3) - a purely additive relationship with no square root. Starting from an integer configuration, every subsequently generated circle inherits an integer curvature through this Vieta-jumping-style recursion.
Is the Apollonian gasket a true fractal with self-similarity?
Yes, though not with a single fixed scaling ratio like the Sierpinski triangle - each gap has a different size and shape. It is statistically self-similar: at any scale, the same tangent-circle-filling rule governs the local structure, and its Hausdorff dimension (about 1.3057) is a well-defined fractal invariant.
Try it live
Everything above runs in your browser — open Apollonian Gasket and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.
▶ Open Apollonian Gasket simulation