Find point inside circle but outside of n- other circles

142 Views Asked by At

There is one green circle and 0 to n red circle(s). I'm trying to find a point inside the green circle, but outside all red circles.

Basically the point have to be in the green area on the given example.

My first attempt was, to loop until I have a point that is inside the green circle and the distance to each red circle is bigger than it's radius.

I think there might be a way better solution without try'n'erroring...

I have the radius und center position of each circle:

Circle | Radius |   X  |   Y
Green  |  12.0  |  9.5 |  6.5
Red C1 |   7.5  |  5.5 | 10.5
Red C2 |   7.5  | 12.0 |  8.5
Red C3 |   7.5  |  5.5 |  5.0

Circle

1

There are 1 best solutions below

0
On

Do you want any kind of reasonable point distribution, or is just one single point enough for you?

If one point is enough, you could

  1. look at all intersections between two circles (including the green one)
  2. drop those which are completely inside a third circle
  3. prefer those which are not on the boundary of a third one either
  4. investigate tangent directions for the remaining ones
  5. take an infinitesimal step in a direction which takes you outside of both, except if one circle is the green one so you want to stay inside