# How to Calculate Radius of Circle Given Two Points and Tangential Circle

In the image below, the two smallest circles and the chord are given to me. What I would like to calculate is the radius of the largest circle, such that it includes the endpoints of the chord and is tangential to the smallest circle. Is there a way to calculate this symbolically?

The following is what I know:

• The center of medium circle is at the origin $$(0,0)$$
• The radius of the medium circle is $$R_m$$, and the small circle is $$R_s$$
• Chord endpoints are given at $$(x_1, y_1)$$ and $$(x_2, y_2)$$
• The center of the smallest circle lies on the medium circle at point $$(S_x, S_y)$$
• Both intersections of the medium and small circles occur within the chord
• The center point of the largest circle can be written as $$(L_x, L_y)$$, where $$L_x=\frac12(x_1+x_2)t$$, and $$L_y=\frac12(y_1+y_2)t$$, for some $$t > 1$$.

I need to compute the center point of the large circle $$(L_x, L_y)$$ given this information. I have created the following system of two equations with two unknowns ($$R_I$$ and $$t$$) given this information, but can't figure out how to solve them:

• $$R_I^2=(\frac12(x_1+x_2)t-x_1)^2+(\frac12(y_1+y_2)t-y_1)^2$$

• $$(R_I-R_s)^2=(\frac12(x_1+x_2)t-S_x)^2+(\frac12(y_1+y_2)t-S_y)^2$$

Any help is greatly appreciated.

The radius of the large circle isn’t an independent variable. It’s equal to the distance from the circle’s center to either of the chord endpoints, so it’s a simple function of $$t$$.

If you subtract the equation of the small circle from that of the large one, you’ll get a linear equation, that of their radical axis. If the two circles are tangent, then this line is also tangent to them both. Applying this constraint should give you an ugly, but straightforward to solve quadratic equation in $$t$$.

I would’ve parameterized the family of large circles a bit differently. All of the circles that share the given chord have equations of the form $$f(x,y)+\lambda g(x,y)=0$$, where $$f(x,y)=0$$ is the equation of the circle that has the chord as its diameter and $$g(x,y)=0$$ is the equation of the line that contains the chord. Proceeding as I described above again leads to a quadratic equation in $$\lambda$$, and the radii of the resulting circles are easily extracted from the equations that result from solving for $$\lambda$$ and substituting.

After thinking about this some more, I realized that I could dramatically simplify the problem if I rotate the image such that the line through the center of the chord is fixed as the y-axis. By doing so, the circle I am looking for is centered at $$(0,L_y)$$. Given this translation, the system of two equations is simplified to

• $$(L_y − S_y)^2 + S_x^2 = (R_I−R_s)^2$$
• $$(L_y - y_1)^2 + x_1^2 = R_I^2$$

When I expand this out, the X and Y parameters combine to be the known radius of the medium circle, so the equations become:

• $$L_y^2 - 2L_yS_y + R_m^2 = (R_I−R_s)^2$$
• $$L_y^2 - 2L_yy_1 + R_m^2 = R_I^2$$

Substituting the second equation into the first yields $$2L_y(y_1-S_y) = R_s^2 - 2R_s\sqrt{L_y^2-2L_yy_1+R_m^2}$$. Solving for $$L_y$$ yields the closed-form:

$$L_y=\frac{R_s^2(S_y+y_1) \pm R_s\sqrt{R_s^2(R_s^2 + 4S_yy_1) + 4R_m^2[(S_y-y_1)^2 - R_s^2]}}{2[R_s^2-(S_y-y_1)^2]}$$

Once $$L_y$$ is known, the remaining quantities are trivial to compute using standard geometry.