# How to find a radius of a circle tangent to another circle and line

As in the image, I have a circle that intersect the $$y$$ axis (or could be a vertical line). I know center and radius of that circle. There is a second smaller circle, inside the bigger one, tangent to the $$y$$ axis (or vertical line) and to the bigger circle. I know the coordinate $$y_A$$ where the smaller circle intersect the vertical line. I have to calculate the radius of the smaller circle $$r$$. I try to do it using trigonometry, but I found a solution to be iterate. I'm looking for a "direct" solution.

• You can draw a triangle with the three corners being $(0,y_a), (x_a, y_a), (x_C,y_c)$. The edge lengths of the triangle are $r, R-r$ and $d=\sqrt{x_C^2 + (y_C-y_a)^2}$. Now you can perhaps solve something from that ... – Matti P. Oct 22 '20 at 9:49
• Let $\ell$ be the vertical line $x=R$. Then the distance from $A$ to $\ell$ equals the distance from $A$ to $C$, that is, the locus of valid $A$ is on a parabola. – Hagen von Eitzen Oct 22 '20 at 9:53

Obviously the circle's centre will be at $$(r,y_A)$$. Then we have the following relation from the tangency with the larger circle: $$\sqrt{(x_C-r)^2+(y_A-y_C)^2}=R-r$$ Let $$(y_A-y_C)^2=K$$, then squaring both sides: $$(x_C-r)^2+K=R^2-2Rr+r^2$$ $$x_C^2-2x_Cr+K=R^2-2Rr$$ $$r(2R-2x_C)=R^2-x_C^2-K$$ $$r=\frac{R^2-x_C^2-K}{2R-2x_C}$$