I recently ran into a computer science problem that asked to uniformly generate random points within a circle. There's numerous algorithmatic ways to achieve this, but I'm interested in some form of a mapping.
My idea is, since generating uniform random points within a square is easy, can one explicitly define a bijective mapping from a square to a circle? (Or any shape to a circle).
If yes, what would be the mapping? Is it linear? And how would one go about defining these explicit mappings in the general case; i.e. given a domain subspace and a codomain subspace, how can one arithmetically find a mapping beyond just "looking at it"?
EDIT: Overlooked issue is, of course, the distribution in the circle also needs to be uniform
Given a point $(x,y)$ chosen uniformly at random on the unit square, take $r = \sqrt x$ and $\theta = 2\pi y$. Going backwards, given $(r,\theta)$, take $x = r^2$ and $y = \frac\theta{2\pi}$.