Original Post
I need an algorithm to randomly generate a point which is guaranteed to lie inside a concave polygon. The initial method I was using was to find a diagonal to the polygon, which is a line between two vertices that does not intersect any edges of the polygon. This can be done in O(n). I can then generate random points on the line, which are all interior to the polygon.
However a line is only a 1D region, and points need to be generated over 2 dimensions. Is there a reliable and fast algorithm that can achieve this?
However a line is only a 1D region, and points need to be generated over 2 dimensions. Is there a reliable and fast algorithm that can achieve this?