0
$\begingroup$

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.

pseudo-code algorithm

Thank you, any help is much appreciated.

$\endgroup$
2
$\begingroup$

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

$\endgroup$
  • $\begingroup$ Yes, that's correct. How do I find that intersection point mathematically? $\endgroup$ – Richard Ellwood Apr 12 '15 at 23:02
  • $\begingroup$ @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$. $\endgroup$ – Jack D'Aurizio Apr 12 '15 at 23:15
  • $\begingroup$ +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. $\endgroup$ – Henry Apr 12 '15 at 23:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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