Given:
- Rectangular region with length l & breadth b
- Circle with radius r
- Circle is contained in rectangular region like shown in below image
See image here - Red are expecting evenly distributed coordinates
Then how to generate random coordinates outside the circle contained in a rectangular region and evenly distributed? (in blue region of below image)
Generate two random values in ranges (uniform distribution in rectangle)
check if point lies outside the circle:
if not - repeat random generation until condition becomes true (this is rejection method)
Generated by this Delphi code for reference