Find a radius of a circle tangent to another circle and line

circleseuclidean-geometrygeometrytangent line

graph

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.

Best Answer

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}$$

Related Question