I saw the following statement posted by Fermat's Library on Twitter:
The way to correctly generate a random point on the surface of a unit sphere is not to pick uniform distributions $\theta$ in $[0,2\pi)$ and $\phi$ in $[0,\pi)$.
Instead, choose $u$ and $v$ from uniform distributions on $[0,1)$. Then,
- $\phi = \cos^{-1}(2v-1)$
- $\theta = 2\pi u$
I can see why uniformly choosing $\theta$ in $[0,2\pi)$ and $\phi$ in $[0,\pi)$ would lead to points near the poles being more likely to be chosen than points near the equator.
But I can't think of an intuitive explanation for why the given solution correctly gives a uniform distribution. Is there a good intuitive explanation for this?