I want to generate random rectangles. That is a pretty easy task. The issue is I need them to not overlap with any of these black dots:
Now I can just tell it to ignore any rectangles it generates if it overlaps with any black dots, but as the dot density increases, it gets to 
CodePudding user response:
Select a random white point.
Find the nearest black dot. This will be the radius of a circle
Create a circle centered at the random point.
Choose 2 points on the circle. Find their opposite point that pass by the center of the circle draw the rectangle from the 4 points.
P.S. Just be sure that the 2 points are not the diameter of the circle...


