Apollonian gasket
Take three circles that touch each other. In the gap between them there is room for exactly one more circle touching all three; each new circle opens three new gaps, and so on forever. The limit is an Apollonian gasket, a fractal of Hausdorff dimension about 1.3057. This page draws it in two different ways.
1. As the orbit of four circles under a group of maps
The picture on my home page (gasket.pdf) was made with Indra, a set of Asymptote programs following Mumford, Series and Wright’s book Indra’s Pearls. It does not construct tangent circles at all. It starts with four circles and applies Möbius transformations, the maps of the complex plane
which send circles to circles (a straight line counts as a circle through \(\infty\)). For this gasket two generators are enough:
\[a(z) = \frac{z}{-2i\,z + 1}, \qquad b(z) = \frac{(1 - i)\,z + 1}{z + 1 + i},\]together with their inverses \(A = a^{-1}\) and \(B = b^{-1}\). The four starting circles are the line \(\operatorname{Im} z = 0\) and three circles below it, and every generator maps the outside of one of them onto the inside of its partner. Applying every word \(h_1 h_2 \cdots h_L\) in the generators (never a letter next to its own inverse) to the starting circles produces circles inside circles inside circles. The pictures below colour a circle by the length \(L\) of the word that made it, cycling red, blue, green, cyan, magenta, yellow as the original does. The closure of all these circles is the limit set of the group: an Apollonian gasket.
The renderer follows a word only while the region that the word maps one of the starting discs into is on screen and larger than a third of a pixel. That region contains every circle that continues the word, so skipping it loses nothing: it is what makes deep zooms cheap. The Schottky option is the other family of groups in Indra, with two hyperbolic generators controlled by p and q: its four starting circles touch in a ring, and the limit set is a wiggly closed curve whose shape you can change.
2. From Descartes’ circle theorem
There is also a direct construction. Descartes found in 1643 that the curvatures \(k = 1/r\) of four mutually tangent circles satisfy
\[(k_1 + k_2 + k_3 + k_4)^2 = 2\,(k_1^2 + k_2^2 + k_3^2 + k_4^2).\]Given three circles, solving for the fourth gives two answers, \(k_4\) and \(k_4' = 2(k_1 + k_2 + k_3) - k_4\): the circles that fit in the gap on either side. That one linear step is the whole engine. A bounding circle is given negative curvature, so the classic starting set is \((-1, 2, 2, 3)\), and from there every curvature is an integer (2, 3, 6, 11, 14, 15, 18, 23, …).
Straight lines are circles of curvature 0; the strip preset starts from two parallel lines and two circles, \((0, 0, 1, 1)\). To treat lines and circles alike the code stores each as a four-number vector (the augmented curvature-centre coordinates of Lagarias, Mallows and Wilks), for which the same rule \(m' = 2(m_1 + m_2 + m_3) - m_4\) works unchanged.
The three tangency points of any gap lie on one more circle, the gap’s dual circle, orthogonal to all three. The demo draws one for every gap.
Switch on “Curvatures” for the bounded preset to see the integers. Every gap lies inside the circle through its three tangency points, which gives an exact bound for skipping whole subtrees.
Why the two pictures show the same gasket
At first sight the two views have little in common: one draws circles nested inside each other that pile up at a few points, the other fills gaps with ever smaller circles. They are in fact two families of circles attached to one gasket, and each family determines the other.
Dual circles. Every gap of a gasket is bounded by three mutually tangent circles. The dual circle of the gap passes through the three tangency points and crosses the three circles at right angles. It is the mirror of the gap: inversion in it fixes the three circles and swaps the circle packed into the gap with the one on its other side. Dual circles are not part of the packing, but they pass through points of the gasket itself, the tangency points, which are what the circles of the packing shrink onto.
The link. The four starting circles of the group view are the line \(\operatorname{Im} z = 0\) and the circles of radius \(\tfrac14\), \(1\), \(1\) below it. They touch each other and have curvatures \(0, 4, 1, 1\), which satisfy Descartes’ equation: \((0 + 4 + 1 + 1)^2 = 36 = 2\,(0 + 16 + 1 + 1)\). So they are a Descartes quadruple, the seed of a gasket of their own. Now take the dual circles of the four gaps between them. They are the unit circle, two circles of radius \(\tfrac12\) and one of radius \(\tfrac13\): curvatures \(-1, 2, 2, 3\), which is exactly the starting set of the second picture. The relation goes both ways: the line \(\operatorname{Im} z = 0\) is the dual circle of the gap between the unit circle and the two circles of radius \(\tfrac12\), since it passes through their three tangency points \(-1\), \(0\) and \(1\). The two starting quadruples are each other’s duals.
What the group does. A Möbius map sends circles to circles and preserves tangency and right angles, so it sends a dual circle to a dual circle. The maps \(a\) and \(b\) take the four starting circles to further circles of the same kind, and this goes on at every level: every circle drawn in the group view is the dual circle of some gap of the \((-1, 2, 2, 3)\) gasket, and the dual circles of the first gaps all appear in the group view. I checked this by computer for every circle through level 5 (about 1,450 of them) and for the dual circles of the first three generations of gaps. It is also why the big coloured circles in the original gasket.pdf look like the dual circles of the second view.
So the group view is the Descartes view with only the dual circles switched on, reached by a different route: Descartes’ equation produces the gaps one generation after another, while the group produces the same circles by composing two maps. Untick “Circles” in the second picture and compare it with the first. The circles agree; only the bookkeeping of the colours differs, since the second picture colours a dual circle by the generation of its gap and the first by the length of the word that produced it. Both families accumulate on the same set, the closure of the tangency points. That set is the Apollonian gasket.
The original static file: gasket.pdf (vector PDF, 1.7 MB). Source: Indra.