# Find the position of a circle tangent to two other circles

Say there are 3 circles, A, centered at point a, B centered at point b, and C, centered at point c. Each has a known radius independent of the others, Ar, Br, and Cr. The positions of a and b are known, but the position of c isn't.

The distance between a and b will always be between (Ar + Br) and (Ar + Br + (2 * Cr)).

I'm looking for an algorithm to find the position of c so that circles A and C are tangent, and circles B and C are tangent. There ought to be two solutions unless a and b are at their maximum allowed distance, in which case there would only be one.

Thank you, any help is much appreciated.

You just need that the distance between the centre of $C$ and the centre of $A$ is $r_A+r_C$, while the distance between the centre of $C$ and the centre of $B$ is $r_B+r_C$, hence you just need to intersect two circles to find the position(s) of $C$.
• @RichardEllwood: you just need to solve the system given by $(x-x_A)^2+(y-y_A)^2=(r_A+r_C)^2$ and $(x-x_B)^2+(y-y_B)^2=(r_B+r_C)^2$ where $(x_A,y_A)$ and $(x_B,y_B)$ are the coordinates of the centres of $A$ and $B$. – Jack D'Aurizio Apr 12 '15 at 23:15
• +1 although as well as the circle centred at A radius $r_A+r_C$ and the circle centred at B radius $r_B+r_C$, it may also be worth drawing the circle centred at A radius $|r_A-r_C|$ and the circle centred at B radius $|r_B-r_C|$ and looking for more intersections. – Henry Apr 12 '15 at 23:18