A
A
anboo2020-06-17 22:30:13
Mathematics
anboo, 2020-06-17 22:30:13

How to avoid blocking a circle with other circles?

I have a grid of coordinates where circles with the same radius are placed in random order.

The circles cannot intersect according to the logic of the game, therefore, it is also necessary to exclude blocking by several circles of some other defined circle (several circles are in a circle and the "surrounded" circle cannot leave it - it is blocked, taking into account the boundaries of the coordinate grid (pressed into a corner) ).

Given a command for circle A to come to the point (X1, Y1) , how to check that circle A does not block any other circle at this point?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sokolov, 2020-06-17
@sergiks

In order not to intersect, one of the options is to turn on “physics” and, when superimposing a pair of circles, move them as if their centers are repelling until they no longer intersect.
To determine if it is not locked, you can try to plot a route, and if it is impossible, then it is locked.
Situations are quite possible when there is no solution: imagine a cramped box filled with balls beyond measure.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question