# Draw all the circles that touch the x-axis and a unit circle

I am trying to plot a circle with radius 1, that touches the $x$-axis in the origin, So it has center $(0,1)$

u = Graphics[{Circle[{0, 1}, 1]}, ImageSize -> 150, Axes -> True]


I have the above, and now I would like to draw all the circles with radius u that touch the $x$-axis and the unit circle.

Is the above Mathematica code a function? And how can I draw all the circles that touch this unit circle?

• You mean radius 1 ? Mar 27, 2018 at 10:55
• only radius 1 for unit circle, the other circles it doesn't matter Mar 27, 2018 at 14:51
• I assume you want the circles that are tangent to the unit circle? Then, what about all the circles tangent to the origin? They touch the $x$ axis and the unit circle. Do you want to include them too? Mar 28, 2018 at 1:10
• anderstood raises a good point; you did not specify if the circles are internally or externally tangent. The solution in my answer will only give the externally tangent solutions, as the internally tangent solutions are trivial to produce. Mar 28, 2018 at 5:22
• I want only the circles that are tangent to the unit circle and the x axis, not the y axis. So J.M. has a correct solution Mar 28, 2018 at 12:35

The general equation of a circle of radius $u$ that is tangent to the $x$-axis is $(x-h)^2+(y-u)^2=u^2$. Our strategy, then, is to find the radical line of this variable circle with the original circle, and then find the condition such that the radical line of both circles is tangent to them as well.

rad = ((x - h)^2 + (y - u)^2 - u^2) - (x^2 + (y - 1)^2 - 1) // Simplify
h^2 - 2 h x - 2 (-1 + u) y


Then, determine the condition so that this line is tangent to the unit circle. In algebraic terms, we want the resulting quadratic polynomial after elimination to be a perfect square:

Solve[Discriminant[x^2 + (y - 1)^2 - 1 /. First[Solve[rad == 0, y]], x] == 0, h]
{{h -> 0}, {h -> 0}, {h -> -2 Sqrt[u]}, {h -> 2 Sqrt[u]}}


where we get two trivial solutions and a solution for both the right and left parts of the plane.

Now, we can visualize:

Graphics[{Circle[{0, 1}, 1],
MapIndexed[{ColorData[97, #2[]], #1} &,
Table[Circle[{2 Sqrt[u], u}, u], {u, 1/20, 2, 1/20}]]},
Axes -> True] You are describing a classic sangaku problem.

Form a right triangle between circle centres. In your case, the unit circle is orange with r1=1. Hence, the circle centres are separated by d=2*Sqrt[r2]. Manipulate[
Graphics[{
EdgeForm[{Thick, Black}],
Orange, Disk[{0, 1}, 1],
Darker@Green, Disk[{2 Sqrt[r2], r2}, r2]
},
PlotRange -> {{-2, 4}, {0, 3}}, Frame -> True],
{{r2, 1, "Right Circle Radius"}, 0.05, 5, Appearance -> "Labeled"}] 