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?

  • $\begingroup$ You mean radius 1 ? $\endgroup$
    – Lotus
    Mar 27, 2018 at 10:55
  • $\begingroup$ only radius 1 for unit circle, the other circles it doesn't matter $\endgroup$
    – Stefan
    Mar 27, 2018 at 14:51
  • 1
    $\begingroup$ 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? $\endgroup$
    – anderstood
    Mar 28, 2018 at 1:10
  • $\begingroup$ 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. $\endgroup$ Mar 28, 2018 at 5:22
  • $\begingroup$ 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 $\endgroup$
    – Stefan
    Mar 28, 2018 at 12:35

2 Answers 2


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.

Start with the radical line:

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]]], #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].

sangaku circles

      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"}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.