A Selection of Problems on Circles

Jaime Rangel-Mondragón

jrangel@uaq.mx
Universidad Autónoma de Querétaro 
Mexico
June, 2004

Permission is hereby granted to reproduce part or all of this file for any purpose 
other than direct profit providing that the source is acknowledged.

The following comprises a small selection of programming exercises on which circles play an important role. They have been compiled from lectures given by the author and are presented in a self-contained manner suitable to be used in the classroom. Descriptions of the algorithms behind the code have been omitted in order to help the teacher to guide the students towards the craft of program design through answering some questions related to the problems both in their algorithmic and implementation forms. For this reason several basic questions are included in each section, some of them presenting the actual code of the solution of the corresponding query. We encourage the reader to change the parameters involved to appreciate the nature of the solution. Some of the pictures are randomly generated and might take repeated runs to fully understand their subtleties. Coding for the generation of a number of animations is also included. Although Mathematica version 5 is used, no particular feature is expected to preclude it from running without change under previous versions. The author would be most grateful for suggestions, corrections or the inclusion of additional questions to further enhance this work..

References

Advanced Euclidean Geometry. A.S. Posamentier. Key College Publishing 2002
Japanese Temple Geometry Problems. H.Fukagawa,D.Pedoe.Winnipeg 1989. Problems 1.1.1,1.2.3 and1.2.4
Pi, Mu, Epsilon Journal, 1951, 185, Problem 16 
Five Hundred Mathematical Challenges. E.J. Barbeau, M.S. Klamkin, W.O.J. Moser. The Mathematical Association of America, 1995. Problem 115
Excursions in Geometry. C. Stanley Ogivly. Dover Publications Inc., 1969
Complex Numbers and Geometry. Liang-shin Hahn. The Mathematical Association of America, 1994
Computational Geometry. M. de Berg, M. van Kreveld, M. Obermars O. Schwarzkopf. Springer, 2000. Section 4.7 
Challenging Problems in Geometry. A. S. Posamentier, C.T. Salkind. Dover Publications Inc, 1988
Mathematical Chestnuts from Around the World. R. Honsberger. The Mathematical Association of America, 2001. Problem 6.10 
Quantum 8, November-December, 1990. Problem 5
The Enjoyment of Mathematics. H. Rademacher, O. Toeplitz. Dover Publications Inc., 1969 Chapter 16
Circles, a Mathematical View. D. Pedoe. Dover Publications Inc., 1979
Mathematical Circles vol. I. H. Eves. The Mathematical Association of America, 2003

Introduction

SetOptions[Graphics,  
        TextStyle -> {FontFamily -> "Arial", 
            FontSize -> 20}, AspectRatio -> Automatic, 
        PlotRange -> All];
<< "Graphics`Colors`"
<< DiscreteMath`ComputationalGeometry`

    
fillCir[c_, r_, col_] := {col, Disk[c, r], Black, 
        Circle[c, r]}
shG[g_] := (Show[Graphics[g]];)
size[v_] := (Sqrt[v . v])
circ[a_, b_, c_] := 
      Module[{x, y, s}, 
s = 
          Solve[{({x, y} - a) . ({x, y} - a) == ({x, y} - 
                      b) . ({x, y} - b), ({x, y} - b) . ({x, y} - 
                      b) == ({x, y} - c) . ({x, y} - c)}, {x, 
              y}]; 
{{x, y}} = ({x, y} /. 
              s); 
{{x, y}, 
          size[{x, y} - a]}]

Questions

Why is the aspect ratio not set as Automatic by default, that is, when would we like to have distorted graphics ? The same question can be asked for PlotRange
It is a bit cunbersome to use the actual names of the colors. There is a utility that makes this use straighforward; which one is it ?
Why we have to use both Disk and Circle in fillCir ?
Why shG includes a semicolon at the end ?
Why size does not work with numbers as arguments?
What is the purpose of function circ ?
Why do we have to use {x,y} in circ ? Can we just use a variable instead of two to make the code more readable ?

Borromean Rings

r = (2/(Sqrt[3]));
shG[{fillCir[{1, (r/2)}, r, Thistle], Circle[{0, r}, r], 
        Circle[{2, r}, r], Circle[{1, (r/2)}, r], 
        Circle[{1, -(r/2)}, r]}]

Questions

Why the name of this section ?
We can easily deduce which of the four circles is  the central circle in the code but how do we identify the others ?
Can we color all three moon shapes with different colors ?
Why is the value of  r the one given ? 
Can we draw the olympic rings using this approach ?
Why don´t we use 1.1547 for the value of r instead ?
What is the value of the area of  any of the moon shapes ?

Circles Associated with a Right Triangle (0,0), (a,0), (b,0)

Clear[x, y, a, b, r]

    
cir = {x, y} /. 
        Solve[{((((b x + a y  - a b))^2)/(r^2)) == (y^2) == 
              (x^2)}, {x, y}]

Clear[x, y, a, b, r]

    
r = (Sqrt[(a^2) + (b^2)]);
cir = {x, y} /. 
        Solve[{((((b x + a y  - a b))^2)/(r^2)) == (y^2) == 
              (x^2)}, {x, y}]

{a, b} = {1, 2};
r = (Sqrt[(a^2) + (b^2)]);
shG[{Line[{{0, 0}, {a, 0}, {0, b}, {0, 0}}], 
        Table[Circle[
            (Subscript[cir, [[i]]]), 
            Abs[(Subscript[cir, [[i, 1]]])]], {i, 4}], 
        Circle[{a, b}/2, (r/2)]}]

Questions

What is the purpose of this exercise ?
Do we really need to use the Clear statement, particularly the second one ?
Why are the two uses of the Solve giving different answers ?
Why was the circle passing through the vertices drawn ?
Why was it considered this particular kind of triangle and not an arbitrary one ?
Are there any interesting formulas relating the values of the radius of the four tangent circles ?
Do we need to use Abs ?

For what values of a , b are all parameters integers? Which of the four is the incircle? Answer:

{a, b} = {1, 2};
shG[{Line[{{0, 0}, {a, 0}, {0, b}, {0, 0}}], Circle[{a, b}/2, (r/2)], 
        Table[{Circle[
              (Subscript[circ, [[i]]]), Abs[(Subscript[circ, [[i, 1]]])]], 
            Text[ToString[i], 
              (Subscript[circ, [[i]]])]}, {i, 4}]}]

Ying Yang

yys[r_, x_] := {Circle[{x - r, 0}, r], 
        Circle[{x + r, 0}, r]}
yyt[n_] := 
      Table[yys[(1/(2^(n + 1))), i], {i, -1 + (1/(2^n)), 1 - (1/(2^n)), 
          (1/(2^(n - 1)))}]

n = 6;
shG[{Circle[{0, 0}, 1, {0, π}], 
          Table[yyt[j], {j, 0, n}]}];

Questions

What is n ?
What is the purpose of functions yys and yyt ?
Can we fill the regions with two colors so that adjacent regions receive different colors ?
The design reminds of a paradox concerning the value of π; which one is it ?
Is this design a fractal ?
Can we alter the code so that only the part within the upper semicircle is shown - without using PlotRange of course ?
Can we substitute (1/(2^n)) at function yyt for a variable to clean the code further ?

Farey

Farey[s_, 0] := s
Farey[s_, n_] := 
      With[{x = Farey[s, n - 1]}, 
Join[{First[x]}, 
          Flatten[Thread[List[Delete[x, -1] + Rest[x], Rest[x]]], 
            1]]]
Farey[n_] := Farey[{{0, 1}, {1, 1}}, n]

(FractionBox  @@  #) & /@  Farey[4] // 
      DisplayForm

Fcircle[{_, 0}] := Circle[{0, 0}, 0]
Fcircle[{p_, q_}] := 
      Circle[{(p/q), (1/(2  (q^2)))}, (1/(2  (q^2)))]

n = 5;
shG[Fcircle[#] & /@ Farey[{{0, 1}, {1, 0}}, n]]

n = 7;
Show[Graphics[Fcircle[#] & /@ Farey[{{0, 1}, {1, 1}}, n]], 
        PlotRange -> {{0, 1/2}, {0, 1/2}}];

Questions

Why is this section called Farey ?
Why we didn't use shG to generate the picture above ?
What is displayed if we don´t use the advantages given by DisplayForm ?
What interesting mathematical properties has Farey ?
What has Fcircle to do with Farey ?
Why was that particular PlotRange chosen ?

Apollonius

\(Apollonius[c1_, c2_, c3_, r1_, r2_, r3_] := 
      Module[{x, y, d, r, 
          s}, 
d = \(IntegerDigits[#, 2, 3] &\) /@ 
              Range[0, 7]\  /. \ 0 -> \(-1\); 
        s = \(Solve[{\(({x, y} - c1)\) . \(({x, y} - 
                          c1)\) == \((r1 + \(#\_\(\([[\)\(1\)\(]]\)\)\) r)\)\^2, \(({x, y} - c2)\) . \(({x, y} - 
                          c2)\) == \((r2 + \(#\_\(\([[\)\(2\)\(]]\)\)\) r)\)\^2, \(({x, y} - c3)\) . \(({x, y} - 
                          c3)\) == \((r3 + \(#\_\(\([[\)\(3\)\(]]\)\)\) r)\)\^2}, {x, y, r}] &\) /@ \ d; 
Select[
          Cases[Flatten[{x, y, r} /. s, 1], {_, _, _Real}], 
          Last[#] > 0 &]]\)

c1 = {Random[], Random[]};
c2 = {Random[], Random[]};
c3 = {Random[], Random[]};
r1 = Random[];
r2 = Random[];
r3 = Random[];
\(\(t = \(Circle[{#\_\(\([[\)\(1\)\(]]\)\), #\_\(\([[\)\(2\)\(]]\)\)}, #\_\(\([[\)\(3\)\(]]\)\)] &\) /@ \ 
          Apollonius[c1, c2, c3, r1, r2, r3];\)\)
shG[{AlizarinCrimson, Circle[c1, r1], Peacock, Circle[c2, r2], 
        LightSteelBlue, Circle[c3, r3], Black, t}]

Questions

Why is this section called Apollonius and what is the problem addressed to in here ?
Did Apollonius supply the names "ellipse", "parabola" and "hyperbola" ? Why was Apollonius called epsilon ?
What is the famous diagram, discovered by Apollonius, connecting the arithmetic mean, the geometric mean and the harmonic mean of two given numbers ?
Where and why is 0 changed to -1 ?
Where and why are binary numbers used ?
What are the reasons behind the filtering of  information provided by the uses of the Select and Cases commands?
Are there any cases in which a lesser number of  circles appear ? What are the maximum and minimum number of circles that can appear in general ?

Given the Radius a, b of the Red and Orange Circles, to Draw the Green One

{a, b} = {3, 5};
c = ((((1/((1/(Sqrt[a])) + (1/(Sqrt[b]))))))^2);
shG[{Line[{{0, 0}, {2 (a + b), 0}}], 
        fillCir[{a, a}, a, DeepMadderLake], 
        fillCir[{a + 2 (Sqrt[ a b]), b}, b, AureolineYellow], 
        fillCir[{a + 2 (Sqrt[ a c]), c}, c, MediumSeaGreen]}]

Questions

How were the names for the colors chosen in Mathematica?
How was the value of c obtained ?

Given the radius a, b, c of three touching circles, to draw the configuration below

{a, b, c} = {7, 3, 11};
sol = {x, y}  /.  
          Last[Solve[{(((a - x))^2) + (((a - y))^2) == (((a + c))^2), (((a + 2 (Sqrt[ a b]) - x))^2) + (((b - y))^2) == (((b + c))^2)}, {x, y}]];
shG[{Line[{{0, 0}, {2 (a + b), 0}}], fillCir[{a, a}, a, Peacock], 
        fillCir[{a + 2 (Sqrt[ a b]), b}, b, Seashell], 
        fillCir[sol, c, PaleVioletRed], 
        Line[{{a, a}, {a + 2 (Sqrt[ a b]), b}, sol, {a, a}}]}]

Questions

How were the conditions for the Solve obtained ?
Do we really need the {x,y} as the last parameter of the Solve ?
Why was the Last used ?
Can we place another circle touching the ground and the white and violet ones ?
Are there any limitations on a, b, c  for the problem to have solution ?
In several places we are going to need closed polygonal; can we define a function similar to Polygon to cater for this ?
Can we generalize this problem ?. For instance: given their radius can we arrange n circles so that they are nonoverlapping and contained in a circle of minimum radius ?

What condition has to be fulfilled by c so that the violet circle is touching the ground? Answer:

Clear[a, b, c]

    
c /. Last[
        FullSimplify[
          Solve[{(((a - x))^2) + (((a - y))^2) == (((a + c))^2), (((a + 2 (Sqrt[ a b]) - x))^2) + (((b - y))^2) == (((b + c))^2), 
              y == c}, {x, y, c}]]]

{a, b} = {7, 3};
c = ((a b (a + b + 2 (Sqrt[a b])))/(((a - b))^2));
sol = {x, y}  /.  
          Last[Solve[{(((a - x))^2) + (((a - y))^2) == (((a + c))^2), (((a + 2 (Sqrt[ a b]) - x))^2) + (((b - y))^2) == (((b + c))^2)}, {x, y}]];
shG[{Line[{{0, 0}, {2 (a + b), 0}}], fillCir[{a, a}, a, Peacock], 
        fillCir[{a + 2 (Sqrt[ a b]), b}, b, Seashell], 
        fillCir[sol, c, PaleVioletRed], 
        Line[{{a, a}, {a + 2 (Sqrt[ a b]), b}, sol, {a, a}}]}]

Has this something to do with the problem of the former section ?

What condition has to be fulfilled by c so that the violet circle is at the same height than the blue one? Answer:

Clear[a, b, c]

    
c /. Last[
        FullSimplify[
          Solve[{(((a - x))^2) + (((a - y))^2) == (((a + c))^2), (((a + 2 (Sqrt[ a b]) - x))^2) + (((b - y))^2) == (((b + c))^2), 
              y + c == 2  a}, {x, y, c}]]]

{a, b} = {7, 3};
c = ((a^2)/(4 b));
sol = {x, y}  /.  
          Last[Solve[{(((a - x))^2) + (((a - y))^2) == (((a + c))^2), (((a + 2 (Sqrt[ a b]) - x))^2) + (((b - y))^2) == (((b + c))^2)}, {x, y}]];
shG[{Line[{{0, 0}, {2 (a + b), 0}}], fillCir[{a, a}, a, Peacock], 
        fillCir[{a + 2 (Sqrt[ a b]), b}, b, Seashell], 
        fillCir[sol, c, PaleVioletRed], 
        Line[{{a, a}, {a + 2 (Sqrt[ a b]), b}, sol, {a, a}}]}]

Has this something to do with the problem of the former section?

Given a circle P and two points A and B outside P which are not in line with its centre, construct a circle to go through A and B and divide the circunference of P into two equal arcs.

{c, r} = {{0, 0}, Random[]};
{θ1, θ2} = {Random[Real, {0, 2  π}], 
          Random[Real, {0, 2  π}]};
A = (1 + Random[]) {Cos[θ1], 
            Sin[θ1]};
B = (1 + Random[]) {Cos[θ2], 
            Sin[θ2]};
q = 
        c + ((((r/size)[c - A]))^2) (c - 
                A);
shG[{fillCir[c, r, LightSalmon], Text["P", {0, 0}], 
        Text["A", A], Text["B", B], Indigo, 
        Circle @@ circ[A, B, q]}]

Questions

What are the roles played by the angles θ1 and θ2 ?
If variable c is the origin, what is the point in using it in the equations ?
How was the equation for q deduced ?
How do we know that A and B are outside P and not in line with its center ?
Why do we needed a @@ in the last Circle ?

2n+3 points (n ≥ 1) are given in the plane, no three on a line and no four on a circle. Prove that there exists a circle through three of them such that, of the remaining 2n points, n are in the interior and n are in the exterior of the circle.

n = 5;
m = 2  n + 3;
g = Table[{Random[], Random[]}, {m}];
i = ConvexHull[g];
{a, b} = 
        Take[(Subscript[g, [[i]]]), 
          2];
h = 
        (Subscript[g, [[Complement[Range[m], Take[i, 2]]]]]);
h = 
        Sort[h, (a - #1) . (((b - #1))/(size[a - #1] size[b - #1])) ≤ (a - #2) . (((b - #2))/(size[a - #2] size[b - #2])) &];
c = 
        (Subscript[h, [[n + 1]]]);
{u, r} = circ[a, b, c];
shG[{fillCir[u, r, Bisque], fillCir[#, 0.01, Beige] & /@ 
          g}]

Questions

Why 2n + 3 points ? Why not to assume n points ?
How do we know g as generated complies with the requirements ?
What is a convex hull ?
Why do we have to use Complement ?
What is the need for this particular kind of Sort ?
What is c ?
Why sometimes the program does not compute the right answer ?

Given two circles of centers A and B and radius a and b, we want the smallest circle enclosing them

A = {Random[], Random[]};
B = {Random[], Random[]};
a = Random[];
b = Random[];

    
d = size[A - B];
{h, k} = {Min[-a, d - b], 
          Max[a, d + b]};
R = A + ((h + k)/2) ((B - A)/d);
r = ((k - h)/2);
shG[{fillCir[R, r, PowderBlue], NavyBlue, Circle[A, a], 
        Circle[B, b]}]

Questions

Why do we use Min and Max ?
How was the expression for R deduced ?
What happens if A = B ?

Circle of minimum radius enclosing a given set of n circles

n = 13;
\(\(cir = 
        Table[{{Random[], Random[]}, 
            Random[]/4}, {n}];\)
\)
cm = Plus @@ Map[First[#] &, cir]/n;
r = Max[Map[Last[#] + size[cm - First[#]] &, cir]];
\(\(While[
t = 
          Table[cm + {2  Random[] - 1, 2  Random[] - 1}/
                100, {20}]; 
t2 = 
          Map[\((h = #; {h, 
                  Max[Map[Last[#] + size[h - First[#]] &, cir]]})\) &, 
            t]; 
t2 = 
          Sort[t2, Last[#1] ≤ Last[#2] &]; 
0 < 
          r - t2\_\(\([[\)\(1, 2\)\(]]\)\), 
{cm, r} = First[t2]];\)
\)
shG[{fillCir[cm, r, 
          CadetBlue], fillCir[First[#], Last[#], PowderBlue] & /@ 
          cir}]

Questions

Why is it false that this minimal circle has to touch at least two circles?
What is cm ?
What is the purpose of the Random[] commands inside the While ?
Why do we take the First of t2 ?
In the previous problem we make use of Min and Max; why we do not use Min here ?

What about the circle of minimum radius enclosing a given set of points? Answer:

n = 1000;
cir = 
        Table[{{Random[], Random[]}, 0.006}, {n}];

    
cm = Plus @@ Map[First[#] &, cir]/n;
r = Max[Map[Last[#] + size[cm - First[#]] &, cir]];
While[
t = 
          Table[cm + {2  Random[] - 1, 2  Random[] - 1}/
                100, {20}]; 
t2 = 
          Map[(h = #; {h, 
                  Max[Map[Last[#] + size[h - First[#]] &, cir]]}) &, 
            t]; 
t2 = 
          Sort[t2, Last[#1] ≤ Last[#2] &]; 
0 < 
          r - (Subscript[t2, [[1, 2]]]), 
{cm, r} = First[t2]];

    
{cm, r}
shG[{fillCir[cm, r, 
          CadetBlue], fillCir[First[#], Last[#], PowderBlue] & /@ 
          cir}]

What happens if we generate the circles following a radial distribution? Answer:

n = 1000;
\(\(\(cir = 
        Table[θ = 
            Random[Real, {0, 2  π}]; {Random[] {Cos[θ], 
                Sin[θ]}, 0.006}, {n}];\)\(
\)
    \)\)
cm = Plus @@ Map[First[#] &, cir]/n;
r = Max[Map[Last[#] + size[cm - First[#]] &, cir]];
While[
t = 
          Table[cm + {2  Random[] - 1, 2  Random[] - 1}/
                100, {20}]; 
t2 = 
          Map[(h = #; {h, 
                  Max[Map[Last[#] + size[h - First[#]] &, cir]]}) &, 
            t]; 
t2 = 
          Sort[t2, Last[#1] ≤ Last[#2] &]; 
0 < 
          r - (Subscript[t2, [[1, 2]]]), 
{cm, r} = First[t2]];

    
{cm, r}
shG[{fillCir[cm, r, 
          CadetBlue], fillCir[First[#], Last[#], PowderBlue] & /@ 
          cir}]

Smallest convex set containing two circles

Clear[x, y, h, k]

    
{a, b, d} = {3, 1, 8};
g = 
        Line[{{x, y}, {h, k}}] /. 
          Solve[{(x^2) + (y^2) == (a^2), (((h - d))^2) + (k^2) == 
                (b^2), ((y - k)/(x - h)) == -(x/y) == ((d - h)/k)}, {x, y, h, k}];
shG[{fillCir[{0, 0}, a, DarkKhaki], fillCir[{d, 0}, b, Chocolate], 
        g}]

Questions

What is d ?
The value of d can be arbitrary > 0 ? 
How were the conditions for Solve deduced ?
Has the system we solve always four solutions ? 
How can we compute the perimeter of this smallest convex set ?
If we remove the convexity requirement, the new solution has anything to do with the inner segments ?
How can we draw the two tangent segments from a given point to a given circle. What happens if this point is inside the circle ?

Arbelos

{a, b} = {2, 1};
shG[{fillCir[{a + b, 0}, a + b, OldLace], 
        fillCir[{a, 0}, a, PowderBlue], fillCir[{2  a + b, 0}, b, Peacock], 
        fillCir[((a (a + b) {2 a + b, 2 b })/((a^2) + a b + (b^2))), ((a b (a + b))/((a^2) + a b + (b^2))), Cerulean]}]

Questions

Why is this section called Arbelos ?
What is a and b ?
How were the conditions inside the last fillCir deduced ?
How can we draw a circle touching all three circles inside the exterior one ?

Animation

Map[(a = #; 
shG[{fillCir[{1, 0}, 1, OldLace], 
                fillCir[{a, 0}, a, PowderBlue], 
                fillCir[{a + 1, 0}, 1 - a, Peacock], 
                fillCir[(a/(1 + (-1 + a) a)) { 
                      1 + a, -2 (-1 + 
                            a)}, ((-a (-1 + a))/(1 + (-1 + a) a)), Cerulean]}]) &, 
        Join[Range[0, 1, 0.05], Range[1, 0, -0.05]]];

Inversion

n = 11;
Δ = (π/n);
shG[{fillCir[{0, 0}, 1 + Sin[Δ], Gainsboro], 
        fillCir[{0, 0}, 1 - Sin[Δ], SteelBlue], 
        Table[fillCir[{Cos[2  i Δ], 
              Sin[2  i Δ]}, Sin[Δ], Gold], {i, 
            n}]}]

Clear[g]

    
inv[z_, r_] := 
      Module[{f}, 
f = ((((r/Abs)[z]))^2) 
            z; 
{Re[f], Im[f]}]

    
g[z_, rad_, r_] := 
      Module[{h, k, a, b, c}, 
a = 
          inv[z + rad , r]; 
b = 
          inv[z - rad , r]; 
c = 
          inv[z + rad I , r]; 
circ[a, b, 
          c]]

Questions

Why do we need to clear g ?
What is an inversion ?
How is inversion implemented in function inv ?
What is the purpose of the first drawing ?
Why do we use circ in function g ?
What happens if instead of z + rad i , we write z - rad i ?

Two circles of radii a and b (a < b) are tangent to each other internally. We want to draw 2n+1 internal chain of tangent circles (Pappus)

n = 3;
{a, b} = {2, 3}; 
    shG[{fillCir[{b, 0}, b, Gainsboro], fillCir[{a, 0}, a, SteelBlue], 
        Table[{c3, r3} = 
            g[a + b + 2  k (b - a) I, b - a, 
              2 (Sqrt[ a b])]; 
fillCir[c3, r3, 
            Gold], {k, -n, n}]}]

In general, the circle corresponding to k = 0 has center { a + b, 0} and radius b - a. What is the center and radius of the circle coresponding to k=1 above? Answer (timing taken on a 2.4 GHz PC):

Clear[a, b]

    
Timing[
      FullSimplify[
        g[a + b + 2 (b - a) I, b - a, 
          2 (Sqrt[ a b])], {{a, b} ∈ Reals, 0 < a < b}]]

We better proceed as follows:

Clear[x, y, r]

    
Timing[
      FullSimplify[
        Solve[{size[{x, y} - {a, 0}] == a + r, 
            size[{x, y} - {a + b, 0}] == b - a + r, 
            size[{x, y} - {b, 0}] == b - r}, {x, y, 
            r}], {{a, b} ∈ Reals, 0 < a < b}]]

Why the enormous difference in computing time ? For k = 2 the result is:

Timing[
      FullSimplify[
        Solve[{size[{x, y} - {a, 0}] == a + r, 
            size[{x, 
                    y} - {((a b (a + b))/((a^2) - a b + (b^2))), ((2 a b (-a + b))/((a^2) - a b + (b^2)))}] == 
              a - ((a^3)/((a^2) - a b + (b^2))) + r, 
            size[{x, y} - {b, 0}] == b - r}, {x, y, 
            r}], {{a, b} ∈ Reals, 0 < a < b}]]

Why did we obtain the first answer ?

Now we separate the above circles and insert a chain of  n tangent circles (Steiner)

Note the Moebius transformation has r2, -r2 and α as fixed points

Clear[g]

    
mob[z_] := 
      Module[{f}, 
f = 
          r2 (( z - r2 α)/(r2 - z α)); 
{Re[f], Im[f]}]

    
g[z_, rad_] := 
      Module[{h, k, a, b, c}, 
a = 
          mob[z + rad ]; 
b = 
          mob[z - rad ]; 
c = 
          mob[z + rad I ]; 
circ[1.  a, b, 
          c]]

n = 7;
Δ = ((1.  π)/n);
r2 = 1 + Sin[Δ];
r1 = 1 - Sin[Δ];
μ = 0;
α = ((r1 r2 - r2 μ)/((r2^2) - r1 μ));
{c1, a} = g[0. , r1];
{c2, b} = g[0. , r2];
shG[{fillCir[c2, b, Gainsboro], fillCir[c1, a, SteelBlue], 
        Table[{c3, r3} = 
            g[(E^(2  i Δ I)), 
              Sin[Δ]]; 
fillCir[c3, r3, 
            Gold], {i, n}]}]

Animation

n = 7;
Δ = ((1.  π)/n);
r2 = 1 + Sin[Δ];
r1 = 1 - Sin[Δ];
Map[(μ = #; 
α = ((r1 r2 - r2 μ)/((r2^2) - r1 μ)); 
{c1, a} = 
              g[0. , r1]; 
{c2, b} = 
              g[0. , r2]; 
shG[{fillCir[c2, b, Gainsboro], 
                fillCir[c1, a, SteelBlue], 
                Table[{c3, r3} = 
                    g[(E^(2  i Δ I)), Sin[Δ]]; 
fillCir[c3, r3, Gold], {i, 
                    n}]}]) &, 
        Join[Range[-1, 1, 0.1], 
          Range[1, -1, -0.1]]];

Circles tangent to other two and having a given radius

{c1, r1} = {{-2, 0}, 3};
{c2, r2} = {{2, 0}, 3};
r = 1. ;
s = 
        Table[Solve[{size[{x, y} - c1]^2 == (((r + i r1))^2), 
              size[{x, y} - c2]^2 == (((r + j r2))^2)}], {i, -1, 1, 
            2}, {j, -1, 1, 2}];
s = 
        Select[Cases[Flatten[{{x, y}, r} /. s, 2], {{_Real, _Real}, _Real}], 
          Last[#] > 0 &];
shG[{fillCir[c1, r1, Gainsboro], fillCir[c2, r2, Gainsboro], 
        Circle[c1, r1], fillCir[First[#], Last[#], Thistle] & /@ 
          s}]

Questions

Can the value of r > 0 be arbitrary ?
What happens if instead of r = 1. we write r = 1 ? Why ?
What happens for r = 1.5 ?
What happens for r = 2. ?
Why do we need to select those for which Last[#] > 0 ?
What happens for the conditions  {c1,r1} = {{0,0},3}, {c2,r2} = {{2,0},4} ?

Circular Billiard

adjust[a_, b_] := 
      Module[{λ, 
          c}, 
c = λ b + (1 - λ) 
              a; 
{λ} = 
          Select[λ /. 
              Solve[c . c == 1], # ≥ 
                1 &]; 
c]

n = 10;
θ = Random[Real, {0, 2  π}];
a = o = 
          Random[] {Cos[θ], 
              Sin[θ]};
θ = Random[Real, {0, 2  π}];
b = {Cos[θ], Sin[θ]};
pth = 
        NestList[({a, b} = #; 
c = 
                2  a . (b/b) . b b - a; 
c = 
                adjust[b, c]; 
{b, c}) &, {a, b}, 
          n];
pth = First /@ pth;

shG[{fillCir[{0, 0}, 1, YellowBrown], Disk[o, 0.04], 
        Line[pth]}]

Questions

What is the problem to solve in this section ?
What is n ?
What is the purpose of function adjust ?
Can we choose a and b so that a regular polygon is traversed ?
What particular cases of paths can be predicted in advance ?
How was the formula for c deduced ?
What is the purpose of the First ?
Given a, how to choose b to get a closed path ?
How if we want to pass through all the points ?
Given a, how to choose b so that we pass through a given point in a specified amound of bounces ?
Can we make the simulation more realistic by taking into account friction so that there will be no need to specify n ?
In the last of the animations below we note that the three circles touch in pairs simultaneously, why is this and how can we change it to be otherwise ? What happens if we use pth in the place of pth2 and why ?
Can we design a simulation of a ball bouncing inside a square ? What is the cartesian equation of a square ? Can we make the animation so that the ball bounces on a rotating square ?
Can we simulate a pool table and reach from one to other of two given points in a specified amount of bounces ?

An animation

n = 10;
θ = Random[Real, {0, 2  π}];
a = o = 
          Random[] {Cos[θ], 
              Sin[θ]};
θ = Random[Real, {0, 2  π}];
b = {Cos[θ], Sin[θ]};
pth = 
        NestList[({a, b} = #; 
c = 
                2  a . (b/b) . b b - a; 
c = 
                adjust[b, c]; 
{b, c}) &, {a, b}, 
          n];
pth = First /@ pth;

    
pth = 
        Flatten[Map[
            Table[λ Last[#] + (1 - λ) 
                    First[#], {λ, 0, 1, 0.1}] &, 
            Partition[pth, 2, 1]], 1];
Map[shG[{fillCir[{0, 0}, 1, YellowBrown], Disk[#, 0.02]}] &, 
        pth];

And another one ...

n = 10;
θ = Random[Real, {0, 2  π}];
a = o = Random[] {Cos[θ], Sin[θ]};
θ = Random[Real, {0, 2  π}];
b = {Cos[θ], Sin[θ]};
pth = 
        NestList[({a, b} = #; 
c = 
                2  a . (b/b) . b b - a; 
c = 
                adjust[b, c]; 
{b, c}) &, {a, b}, 
          n];
\(\(\(pth = First /@ pth;\)\(
\)
    \)\)
pth = 
        Flatten[Map[
            Table[λ Last[#] + (1 - λ) 
                    First[#], {λ, 0, 1, 0.2}] &, 
            Partition[pth, 2, 1]], 1];

    
Map[
        shG[{fillCir[{0, 0}, 1.4, YellowBrown], 
              fillCir[#, 0.4, Chartreuse]}] &, pth];

A Final One

n = 20;
θ = Random[Real, {0, 2  π}];
a = o = Random[] {Cos[θ], Sin[θ]};
θ = Random[Real, {0, 2  π}];
b = {Cos[θ], Sin[θ]};
pth = 
        NestList[({a, b} = #; 
c = 
                2  a . (b/b) . b b - a; 
c = 
                adjust[b, c]; 
{b, c}) &, {a, b}, 
          n];
\(\(\(pth = First /@ pth;\)\(
\)
    \)\)
pth = 
        Flatten[Map[
            Table[λ Last[#] + (1 - λ) 
                    First[#], {λ, 0, 1, 0.05}] &, 
            Partition[pth, 2, 1]], 1];

    
θ = Random[Real, {0, 2  π}];
a = o = Random[] {Cos[θ], Sin[θ]};
θ = Random[Real, {0, 2  π}];
b = {Cos[θ], Sin[θ]};
pth2 = 
        NestList[({a, b} = #; 
c = 
                2  a . (b/b) . b b - a; 
c = 
                adjust[b, c]; 
{b, c}) &, {a, b}, 
          n];
\(\(\(pth2 = First /@ pth2;\)\(
\)
    \)\)
pth2 = 
        Flatten[Map[
            Table[λ Last[#] + (1 - λ) 
                    First[#], {λ, 0, 1, 0.05}] &, 
            Partition[pth2, 2, 1]], 1];

    
Map[
        shG[{fillCir[{0, 0}, 3.4, YellowBrown], 
              fillCir[2 
                   (Subscript[pth2, [[#]]]), 1.4, Chartreuse], 
              fillCir[(Subscript[pth, [[#]]]) + 
                  2  (Subscript[pth2, [[#]]]), 0.4, LightSteelBlue]}] &, 
        Range[Length[pth]]];

A Challenging Configuration

Given that the largest circle has radius 1, to obtain the appropriate radia and size of the rectangle  with the tangencies indicated in the configuration below:

{a, b, c, y, w} = {(1/16) (((-1 + (Sqrt[2]) + (Sqrt[11 - 2 (Sqrt[2])])))^2), 
          (4/(((-1 + (Sqrt[2]) + (Sqrt[11 - 2 (Sqrt[2])])))^2)), 
          (1/8) (15 + 2 (Sqrt[2]) - (Sqrt[185 + 28 (Sqrt[2])])), 
          (1/4) (-3 + (Sqrt[25 + 16 (Sqrt[2])])), 
          (1/8) (11 + 
                2 (Sqrt[2]) + (Sqrt[97 + 44 (Sqrt[2])]))};
shG[{fillCir[{1, 1}, 1, MediumTurquoise], 
        fillCir[{w - a, a}, a, Peacock], 
        fillCir[{1 + 2 (Sqrt[ b]), 2 - b}, b, Cerulean], 
        fillCir[{h - c, a + y}, c, DarkTurquoise], 
        Line[{{0, 0}, {w, 0}, {w, 2}, {0, 2}, {0, 0}}]}]

Questions

The radius of the largest circle allows us to conclude that the height of the rectangle is 2. What do the parameters a, b, c, y and w stand for ?
From the figure, deduce that b = (1/(4  a))
By using Phytagoras theorem, deduce that c = 2 - 2 (Sqrt[2  a])  + a
Deduce that y = 2 ((Sqrt[2  a])  - a)
Deduce that h = 1 + 2 (Sqrt[ a]) + a
By finding other equations incorporating the tangency conditions, use Solve to obtain the values provided in the code above
Why there is no need to involve trigonometric functions in this exercise ?
To what rational numbers are a and  b very close ?