Math
Tangent circles
Fit a fourth disc between three touching discs until it touches all of them, with the narrowest gap magnified; compare its curvature with Descartes' relation, then find the second solution - an enclosing circle, a line or an outside circle - and grow the Apollonian packing.

What happens
Three discs touch in pairs. Which circle touches all three? Fit a brass ring into the middle: move it, pull its rim, fine-tune with the wheel; the inset magnifies the worst gap. Curvature k = 1/r decides the size: Descartes' relation ties the four curvatures together and gives two answers. The second is signed - negative for a circle that encloses the three, zero for a straight line, positive for a circle outside them. Repeating the construction in every new gap grows the Apollonian packing.
Equations used in the module
Equations k = 1/r; (k₁+k₂+k₃+k₄)² = 2(k₁²+k₂²+k₃²+k₄²) k₄ = k₁+k₂+k₃ ± 2√(k₁k₂+k₂k₃+k₃k₁) + : the inner circle, k₄ > 0 − : k₄ < 0 encloses the three, k₄ = 0 a line, k₄ > 0 a circle outside packing: k' = 2(k₁+k₂+k₃) − k₄, k'z' = 2(k₁z₁+k₂z₂+k₃z₃) − k₄z₄


