## Apollonian gaskets and Descartes’ Theorem

In my previous post, I explained a recursive procedure for drawing Apollonian gaskets. Given any three mutually tangent circles, there are exactly two other circles which are mutually tangent to all three (forming what we called a “kissing set”). This also means that if we start with a kissing set, we can remove any one of the circles and replace it with its “alternate”—that is, the unique other circle which is also mutually tangent with the remaining three circles. Repeating this process ad infinitum generates an infinite Apollonian gasket (in practice, we can keep going until the circles get too small to draw).

So far, however, I have only claimed that various things exist. But to actually draw an Apollonian gasket, we have to start dealing concretely with centers, radii, and so on—how do we actually compute the positions and sizes of the circles involved?

This is where something called Descartes’ Theorem begins to play a starring role. Given a circle $C$ with radius $r$, define the curvature of $C$, denoted $\kappa$, by $\displaystyle \kappa = 1/r,$

that is, the curvature is the reciprocal of the radius. Circles with a small radius have a large curvature —intuitively, they have to curve a lot to fit into a small space; whereas circles with a large radius have a small curvature, since they can curve at a more leisurely pace. Curvature is like how much you have to turn the steering wheel of a car (or the handlebars of a bike) to turn in a circle: you have to turn the steering wheel a lot (large curvature) to turn in a small circle, and only a little (small curvature) to turn in a big circle.

OK, so now for the theorem: if we look at the curvatures $\kappa_1, \dots, \kappa_4$ of four mutually tangent circles (that is, a kissing set), then the sum of their squares is equal to half the square of the sum. That is, $\displaystyle \kappa_1^2 + \kappa_2^2 + \kappa_3^2 + \kappa_4^2 = \frac{1}{2}(\kappa_1 + \kappa_2 + \kappa_3 + \kappa_4)^2.$

For example, in this configuration: the curvatures of the four circles are—in order from the biggest circle to the smallest—2, 4, 7, and (approximately) 27.1421356… (you’ll have to take my word on these, I guess). We can verify that $2^2 + 4^2 + 7^2 + 27.1421356^2 \approx 805.6955262\dots$, and also $(2+4+7+27.1421356)^2 \approx 1611.3910524\dots$, half of which is $805.6955262\dots$, as expected.

This is an amazing theorem, which (at the moment) I have no idea how to prove. (Perhaps later this summer I will track down the proof and write about it here.) But it gets much, much cooler. It turns out that this theorem can be generalized in all sorts of ways.

First, as stated, the theorem only applies to kissing sets where the circles are all externally tangent, as in the example above. With one small change, however, it applies to other configurations as well. If a circle is internally tangent to the other circles—that is, it has other circles inside it—then we will think of it as having a “negative” radius, and therefore a “negative” curvature as well. This new notion of “positive or negative curvature” we will call the (signed) bend of a circle, denoted by the letter b. It turns out that using bends, the theorem continues to hold even when some of the circles are inside another (in fact, it even holds when one or two of the “circles” are straight lines, in which case we say they have a bend of zero): $\displaystyle b_1^2 + b_2^2 + b_3^2 + b_4^2 = \frac{1}{2}(b_1 + b_2 + b_3 + b_4)^2.$

For example: In the above configuration, the circles have bends of 2, 4, 7, and -1.1421356…, and one can verify that $\displaystyle 2^2 + 4^2 + 7^2 + (-1.1421356)^2 = \frac{1}{2}(2 + 4 + 7 - 1.1421356)^2.$

The theorem can also be generalized to higher dimensions: in three dimensions, five spheres can be mutually tangent, and the sum of the squares of their bends is equal to one-third the square of the sum; generally, in $n$ dimensions, $n+2$ hyperspheres can be mutually tangent, and the sum of the squares of their bends is equal to $1/n$ times the square of the sum. (As a fun historical note, these generalizing results were first published in poem form!)

Using Descartes’ Theorem, given the signed bends of three mutually tangent circles, we can solve for a fourth. We end up with a quadratic equation, which yields two different solutions: in particular (as you might like to verify yourself), $b_4 = s \pm r$, where $s = b_1 + b_2 + b_3$ is the sum of the other bends, and $\displaystyle r = 2 \sqrt{b_1 b_2 + b_1 b_3 + b_2 b_3}.$

Even better, once we have four bends $b_1, \dots, b_4$ which satisfy Descartes’ Theorem, if we remove one of them (say, $b_4$) and want to compute its “alternate”, we don’t have to solve the whole quadratic equation again, since the two solutions to the quadratic satisfy $\displaystyle b_4 + \overline{b_4} = 2 (b_1 + b_2 + b_3).$

So if we already have one value for $b_4$, we can just subtract it from double the sum of the other three bends to find the second value of $b_4$.

Of course, finding the bends of circles is not quite enough—how do we actually compute the positions of the circle centers? It turns out that comes from yet another generalization of Descartes’ Theorem, which I’ll explain in my next post! 