C.C. License

Claus Johansen, Sønderborg, Denmark, 2014-11-30 -> 2020-01-14

Apollonius' Problem


0) Contents:

1) Preface

2) Apollonius

3) The Problem

4) Initial Formulation

5) Preparation

6) The General Solution

7) All Solutions

8) The ± Signs

9) Subsequent processing

Top Up Down Bot.

1) Preface

Top Up Down Bot.

2) Apollonius

This paragraph is a slightly rearranged extract of the Wikipedia article:

Wikipedia, the free encyclopedia

Apollonius of Perga [Pergaeus] (Ancient Greek: Άπολλώνιος) (c. 262 BC - c. 190 BC).

Apollonius was a Greek geometer and astronomer noted for his writings on conic sections. His innovative methodology and terminology, especially in the field of conics, influenced many later scholars including Ptolemy, Francesco Maurolico, Johannes Kepler, Isaac Newton, and René Descartes. It was Apollonius who gave the ellipse, the parabola, and the hyperbola the names by which we know them.

The hypothesis of eccentric orbits, or equivalently, deferent and epicycles, to explain the apparent motion of the planets and the varying speed of the Moon, is also attributed to him. Apollonius' theorem demonstrates that the two models are equivalent given the right parameters. Ptolemy describes this theorem in the Almagest XII.1.

Apollonius also researched the lunar history, for which he is said to have been called Epsilon (ε). The crater Apollonius on the Moon is named in his honour.


Top Up Down Bot.

3) The Problem

Find the up to 8 circles that are tangents to 3 given circles:

Fig. 1: The problem.

3.1) Comments

Apollonius' Problem was initially formulated as a classical compass and straightedge problem and there exist some solutions of this type. But shown here is only a simple analytical solution.

There exist also several different analytical solutions. The one shown here is based on the Pythagorean formula, others uses Heron's Formula or completely different principles.

Top Up Down Bot.

4) Initial Formulation

In plain words: For an analytical solution, the key relationship of all given circles and any tangent circle must be:

The distance between circle centres = Sum of circle radii.

When this relationship is used successively for all 3 given circles it leads to 3 equations:

If the 3 given circles are denoted A, B and C with the centre coordinates (sA, tA), (sB, tB) and (sC, tC) and the radii rA, rB and rC then a solution to the problem, a tangent circle with centre at (s0, t0) and radius r0 must satisfy these 3 equations:

eq.4.1   (4.1)
eq.4.2   (4.2)
eq.4.3   (4.3)

Where "-" in the "±" indicates that the respective given circle is circumscribed by the tangent circle and vice versa.

If the 3 equations are squared to get rid of the somewhat awkward square roots, the general equations look like:

eq.4.4   (4.4)
eq.4.5   (4.5)
eq.4.6   (4.6)

Top Up Down Bot.

5) Preparation

The relative simplicity of the solution relies on a well-chosen positioning of the 3 given circles in a convenient coordinate system:

Fig.02 Fig.03
Fig. 2: Initial coordinate system. Fig. 3: Transformed coordinate system.

The process can be seen as a two-step procedure:

  1. A rotation to align the x-axis with two circle centres, here A and B.
  2. A combined x- and y-translation to make the x-axis pass through the centres of two circles (here A and B) and make the y-axis pass through the centre of the third circle (here C).

5.1) Rotate

Find the centre coordinate distances (A & B):

eq.5.01   (5.1)
eq.5.02   (5.2)

Find the angle of rotation by e.g.:

eq.5.03   (5.3)

NB: Check the use of the atan2-function. Shown here as atan2(y, x) but is often defined as atan2(x, y).

Rotate the 3 centre coordinates to the intermediate coordinate system (u, v) by the general formulas:

eq.5.04   (5.4)
eq.5.05   (5.5)

5.2) Translate

Align the rotated coordinate system (u, v) with two circle centres to form the coordinate system shown in fig. 3 (x, y). It's simply equal to two circle centre coordinates in the rotated coordinate system (u, v):

eq.5.06   (5.6)
eq.5.07   (5.7)

Translate the 3 centre coordinates to the desired coordinate system (x, y) by the general formulas:

eq.5.08   (5.8)
eq.5.09   (5.9)

5.3) Effect

The 3 equations from § 4, eq. 4.4, 4.5 and 4.6 will now take the form:

When the 3 given circles are denoted A, B and C with the centre coordinates (xA, 0), (xB, 0) and (0, yC) and the radii rA, rB and rC then a solution to the problem, a tangent circle with centre at (x0, y0) and radius r0 must satisfy these 3 equations:

eq.5.10   (5.10)
eq.5.11   (5.11)
eq.5.12   (5.12)

If finally it's implicit understood, that the given circles radius can have a sign, depending on whether they are circumscribed by the tangent circle or not, the somewhat confusing ± signs can be omitted. The 3 equations can then be written as:

eq.5.13   (5.13)
eq.5.14   (5.14)
eq.5.15   (5.15)

Where a negative given circle radius indicates that the respective given circle is circumscribed by the tangent circle and vice versa.

It's the solution of these 3 equations that is shown below.

5.4) Comments

The number of constants in the equations is by this procedure reduced from 9 to 6:

This reduces the amount of work and the complexity considerably!

There are 6 possible ways of transforming the coordinate system, depending on the numbering sequence of the 3 given circles, but they will in the end all lead to the same results:

Fig. 4: Possible coordinate systems for transformation.

Top Up Down Bot.

6) The General Solution


eq.6.01   (6.01)
eq.6.02   (6.02)
eq.6.03   (6.03)
eq.6.04   (6.04)
eq.6.05   (6.05)
eq.6.06   (6.06)
eq.6.07   (6.07)
eq.6.08   (6.08)
eq.6.09   (6.09)
eq.6.10   (6.10)
eq.6.11   (6.11)

And let:

eq.6.12   (6.12)
eq.6.13   (6.13)
eq.6.14   (6.14)
eq.6.15   (6.15)
eq.6.16   (6.16)
eq.6.17   (6.17)
eq.6.18   (6.18)
eq.6.19   (6.19)
eq.6.20   (6.20)

Then let:

eq.6.21   (6.21)
eq.6.22   (6.22)
eq.6.23   (6.23)

Further let:

eq.6.24   (6.24)
eq.6.25   (6.25)
eq.6.26   (6.26)

Finally let:

eq.6.27   (6.27)

Then a general solution to Apollonius' Problem, represented by the radius r0 and centre coordinates (x0, y0) can be found as:

eq.6.28   (6.28)
eq.6.29   (6.29)
eq.6.30   (6.30)

6.1) Comments

The equations are quite robust and will give solutions in most cases. Some of the proposed solutions will not be correct and this should be checked e.g. by comparing the centre distances of the circles with the sum of radii - fully analogue to the way the Initial equations were established, cf. eq. 4.1 - 4.3, 4.4 - 4.6, 5.10 - 5.12 or 5.13 - 5.15.

The equations can handle the given circles and tangent circles to degenerate into points but not that they degenerate into straight lines.

In then r0 expression (eq. 6.28) D can become negative.

In then r0 expression (eq. 6.28) A can become zero and thereby lead to a zero denominator.

Top Up Down Bot.

7) All Solutions

The up to 8 solutions can be obtained by varying the sign of the 3 given circle radii A, B and C. If the radius is positive, the respective base circle is placed outside the tangent circle. If the radius is negative, the respective given circle is placed inside the tangent circle.

The solutions can be numbered as:

No rA rB rC
1 + + +
2 - + +
3 + - +
4 + + -
5 + - -
6 - + -
7 - - +
8 - - -

Fig. 5: Transformed solutions.

Top Up Down Bot.

8) The ± Signs

There are two ± signs in the solution:

8.1) The ± Sign in the "r" equation (6.28)

The ± signs in the "r" equation (6.28) take care of double solutions. Normally the "-" sign should be used, but in some special cases both signs can be correct. One example is shown below.

According to the numbering presented in the table in the previous section, these solutions are designated as no 4-, 4+, 5-, 5+ , 6-, 6+, 8- and 8+:

Fig. 6: Transformed double solutions.

8.2) The ± Sign in the "y" equation (6.30)

Both signs can be correct individually and occur with same frequency.

Top Up Down Bot.

9) Subsequent processing

If the problem was initially transformed from a (s, t) coordinate system to a (x, y) coordinate system, the solution can be transformed back. It's the reverse operations of the preparation in § 5 "Preparation" and the properties found there: Δu, Δv and α will be re-used here.

9.1) Translate

Translate the centre coordinates back to the intermediate coordinate system (u, v) by the general formulas:

eq.9.01   (9.1)
eq.9.02   (9.2)

9.2) Rotate

Rotate the centre coordinates back to the initial coordinate system (s, t) by the general formulas:

eq.9.03   (9.3)
eq.9.04   (9.4)
Fig. 7: The solution.

Top Up Down Bot.