Suppose I have a regular polygon in the Cartesian plane, centered at the origin with circumradius $1$, aligned with one vertex at $(1, 0)$. Given a source of independent, uniformly distributed random variables on $[0..1)$, how can I choose a point within the polygon, randomly, with uniform distribution, using only finitely many inputs?
Is this possible for all regular polygons or only for certain numbers of sides? (Of course the square case is trivial.)
I cannot use [rejection sampling](https://en.wikipedia.org/wiki/Rejection_sampling) within a bounding area (e.g. the unit square) as this requires an unbounded (heh) number of random selections.
I know that a random point can be chosen inside a circle by randomly choosing an angle (mapping one input to $[0..2\pi)$) and distance from the origin (taking the square root of the input variable to correct for the bias). However, this doesn't seem to work for polygons; if I scale the chosen "radius" to fit within the polygon, the result will then show a bias towards the perpendicular bisectors of the sides (and away from the lines connecting the centre to the edges - for the same reason that the square-root correction was necessary).
----
<small>This question is inspired by a [recent Stack Overflow question](https://stackoverflow.com/questions/76983253). I believe I have an answer, but I would prefer to let others offer an answer first.</small>