Scroll to zoom • Drag to pan

Frequently Asked Questions

What is an Apollonius gasket?

An Apollonius gasket (also called an Apollonian gasket) is a fractal generated by starting with three mutually tangent circles, finding the circle that fits in the gap between them using Descartes' Circle Theorem, then recursively filling every new gap indefinitely. The result is an infinitely complex arrangement of tangent circles that never overlap and leave no gaps.

What is Descartes' Circle Theorem?

Descartes' Circle Theorem states that if four circles are mutually tangent, their curvatures k1, k2, k3, k4 satisfy (k1+k2+k3+k4)² = 2(k1²+k2²+k3²+k4²). Given three tangent circles, this lets us solve for the curvature of a fourth circle tangent to all three. The theorem was discovered by Rene Descartes in 1643 in a letter to Princess Elisabeth of Bohemia.

What is curvature in circle packing?

Curvature k equals 1/r where r is the circle's radius. A large curvature means a small, tightly curved circle. The outer bounding circle is assigned negative curvature because the other circles are packed inside it — this sign convention makes the Descartes theorem work correctly. Flat lines can be treated as circles with curvature zero (infinite radius).

How do you find the centre of the new tangent circle?

The complex extension of Descartes' theorem gives the centre. If z = x + iy encodes each circle's centre as a complex number, then k4·z4 = k1z1 + k2z2 + k3z3 ± 2√(k1k2z1z2 + k2k3z2z3 + k3k1z3z1). The two sign choices yield the two circles that can be tangent to the triplet — one nestled inside the gap, one enclosing everything.

Is the Apollonius gasket a true fractal?

Yes. The gasket has Hausdorff dimension approximately 1.3057, independent of the initial configuration. It is self-similar in the sense that every interstice (gap) contains a scaled copy of the whole pattern, and the circles become arbitrarily small. The total area of the circles converges to less than the area of the bounding circle, leaving a Cantor-like residual set.

What are Apollonian integers?

When the four initial curvatures are integers, every subsequent curvature in the gasket is also an integer. These are called Apollonian integer packings. The classic example starts with curvatures -1, 2, 2, 3. The negative -1 denotes the large enclosing circle. Number theorists study which integers appear as curvatures in Apollonian packings — it is an active research area connected to the theory of quadratic forms.

Who first described this fractal?

Apollonius of Perga (c. 262–190 BC) studied tangent circles in ancient Greece. Rene Descartes rediscovered the curvature relation in 1643. The modern mathematical study was formalised by Frederick Soddy (who also published Soddy's circles), and later by Graham, Lagarias, Mallows, Wilks and Zannier, who proved deep results about integer Apollonian packings in the 21st century.

Why does the simulation stop at a certain depth?

The recursion is theoretically infinite, but circles quickly become smaller than a pixel. The simulation stops when a circle's radius in screen pixels falls below the minimum radius threshold (default 1 px). Increasing the threshold gives faster rendering; decreasing it reveals finer fractal detail. The depth slider provides an additional hard limit on recursion levels regardless of radius.

Can I zoom into the gasket?

Yes. Use the mouse scroll wheel or the zoom slider in the HUD to zoom in, and click-drag to pan. The fractal detail visible depends on the minimum radius threshold — set it lower to see finer circles when zoomed in. On touch devices, pinch-to-zoom and swipe gestures are supported. The zoom factor is shown live in the HUD.

What do the colours represent?

Circles are coloured by their generation depth in the recursion. Generation 0 circles (the initial triplet) use one hue; deeper generations shift hue along the selected palette gradient. This makes the fractal hierarchy visually clear — older, larger circles have distinct colours from the tiny nested ones. Four palettes are available: Violet, Spectrum, Ember, and Ice.

What is the connection between circle packing and number theory?

Apollonian circle packings have deep connections to number theory, hyperbolic geometry, and group theory. The set of tangency points of an Apollonian gasket is a limit set of a Kleinian group — a group of Mobius transformations of the Riemann sphere. The curvatures in integer packings satisfy congruence conditions studied via the theory of quadratic forms and the Local-Global principle for thin groups.

About Apollonius Circles

An Apollonius gasket (Apollonian gasket) is an infinitely complex fractal built from mutually tangent circles. Starting with three mutually tangent circles, Descartes' Circle Theorem — (k₁+k₂+k₃+k₄)² = 2(k₁²+k₂²+k₃²+k₄²) where k = 1/radius — uniquely determines the curvature of a fourth circle tangent to all three. Each new circle creates three new gaps, which are filled recursively, generating a self-similar pattern whose Hausdorff dimension is approximately 1.3057. When the initial four curvatures are integers, every subsequent curvature in the entire infinite gasket is also an integer — a remarkable number-theoretic property connecting circle packing to the theory of quadratic forms.

Scroll to zoom and drag to pan the canvas. The Max depth and Min radius sliders control how many recursion levels are rendered before circles become too small to draw. Four colour palettes (Violet, Spectrum, Ember, Ice) colour each circle by its generation depth, making the fractal hierarchy immediately visible. Choose from four seed configurations — including the classic integer packing with curvatures −1, 2, 2, 3 — to see how the initial geometry shapes the final pattern.

Frequently Asked Questions

What exactly is Descartes' Circle Theorem?

Published by René Descartes in a 1643 letter to Princess Elisabeth of Bohemia, the theorem states that if four circles are mutually tangent their curvatures k₁, k₂, k₃, k₄ satisfy (k₁+k₂+k₃+k₄)² = 2(k₁²+k₂²+k₃²+k₄²). Solving for k₄ gives k₄ = k₁+k₂+k₃ ± 2√(k₁k₂+k₂k₃+k₃k₁), yielding two solutions — the two circles that can be tangent to the given triple.

Why is the outer bounding circle given negative curvature?

Curvature k = 1/r is positive when a circle curves towards its own interior (ordinary circles), and negative when the other circles are packed inside it. The outer bounding circle encloses everything, so the packed circles touch its inner surface. Using k = −1/r for the outer circle makes Descartes' theorem work correctly with the same formula for all configurations.

What is the Hausdorff dimension of an Apollonius gasket?

The Hausdorff dimension of an Apollonian gasket is approximately 1.3057, independent of which initial configuration was chosen — a value rigorously established by Thomas McMullen in 1998. It lies between 1 (a curve) and 2 (a filled area), reflecting the fact that the gasket fills the plane neither as sparsely as a curve nor as densely as a solid region.

What are Apollonian integers and why are they remarkable?

When the first four curvatures are integers, every curvature generated by the recursion is also an integer, proved directly from Descartes' theorem. The classic example starts with −1, 2, 2, 3 and produces circles with curvatures 6, 11, 14, 15, 18, 23, … Which positive integers appear is an active research question connected to quadratic forms and thin groups in number theory.

How is the centre of each new tangent circle computed?

The complex extension of Descartes' theorem gives the centre via k₄z₄ = k₁z₁ + k₂z₂ + k₃z₃ ± 2√(k₁k₂z₁z₂ + k₂k₃z₂z₃ + k₃k₁z₃z₁), where z = x + iy encodes each circle's centre. This elegant formula computes both the position and the two tangent-circle choices in one step, discovered by Philip Beecroft (1842) and later by Frederick Soddy (1936).

Who was Apollonius of Perga and what did he actually prove?

Apollonius (c. 262–190 BC) was a Greek mathematician from Perga in modern Turkey, best known for his eight-book treatise Conics. His lost work On Tangencies addressed finding circles tangent to three given circles — the Problem of Apollonius — which has up to eight solutions. The gasket named after him was formalised much later using Descartes' curvature formula.

Is there a connection between Apollonian gaskets and hyperbolic geometry?

Yes — a deep one. The tangency points of an Apollonian gasket form the limit set of a Kleinian group — an infinite group of Möbius transformations of the Riemann sphere. The gasket lives on the boundary of hyperbolic 3-space, and the packing symmetries are the isometries of a hyperbolic tetrahedron. This has driven major advances in spectral theory and ergodic theory on hyperbolic manifolds.

Why does the simulation stop before circles become infinitely small?

The recursion is theoretically infinite, but circles below about 1 pixel in screen radius are imperceptible. The simulation halts when a circle's screen radius falls below the minimum radius threshold. Decreasing the threshold reveals more fractal detail at the cost of longer computation; the depth slider adds an independent hard cap to prevent runaway recursion.

What is Soddy's hexlet and how is it related?

Soddy's hexlet (1936) is a 3D analogue: given two spheres internally tangent to a third, exactly six spheres can be simultaneously tangent to all three and to each other, forming a ring. Frederick Soddy discovered this and announced it in a poem in Nature alongside the 3D Descartes theorem for spheres — both the hexlet and the Apollonian gasket are manifestations of the same inversive geometry.

What is the connection between Apollonian packings and number theory?

Apollonian packings have deep connections to the Local-Global Conjecture: it is conjectured (and partially proved by Bourgain, Kontorovich and others) that every sufficiently large integer satisfying a finite set of congruence conditions actually appears as a curvature. The packing group is a "thin group" in the sense of number theory, making this one of the most active research frontiers in arithmetic geometry.

How do the palette colours map to fractal depth?

Each circle is assigned a generation depth (0 for the seed circles, 1 for the first new circles, and so on). The palette function maps depth linearly to a hue or brightness value, so the oldest, largest circles have one colour and the newest, smallest circles have another. This makes the recursive structure immediately perceptible — each visible colour boundary marks one step deeper in the infinite hierarchy.