I upvoted this question because I really like it. I imagine there’s a lot of ways to solve this, you could go all mathy about it, and solve circle equations, intersections and whatnot.
Or (I think a simpler way, not necessarily the best) would be to use raycasting (even a linecast would work) as @raimon.massanet said (I’m not sure if this is what he had in mind), my idea is, to let each of those objects scan
its surrounding area just like a radar, the length/distance of how further away from your object you’d scan, is r - delta
: r is the radius of the circle, delta is a small value. If the scanner ray ever detect a point, you nuke that point because it definitely doesn’t belong to the current circle (since it’s inside its radius), but to another circle. Do the same for all the other objects.
This will work for any number of circles, regardless of the circles’ radius. But first, again you’d have to project everything to 0 height as per the previous comment from raimon.
Here’s an illustration using the best drawing tool ever exist (MS Paint) - (I think MS now lets you download a trial version)

In the first state there’s no intersection, nothing’s happening. In the 2nd, 3 circles intersect, the scratches indicate points that have been deleted, because they’re inside the circle’s radar. Notice how the ray/line scanner doesn’t reach the circle’s area, it’s slightly less than its radius.
Also, in order for your ray/line to detect the points, they can’t be just a Vector3
or else there’s nothing to detect, they have to be gameObjects
I believe, you could make a Point
class, have it inherit from MonoBehaviour
and all it has is a Vector3
property representing its position (returns transform.position
)
If you’re a circle, How can you tell if a point is inside you?
Simple, if the distance between you and that point is less than your radius.
I’ve put some simple equations, on where you’d have an intersect between 2 circles, when there’s none, etc in the awesome MS Paint draw as well (dist
is the distance between two circles, r1
is the radius of circle1
, r2
’s the same for circle2
)
Again, just yielding some ideas…