1

Given the unit sphere in $\mathbb{R}^3$, we want to pick points uniformly across its surface. My first thought was to parameterize by spherical coordinates $$ (\theta,\phi) \mapsto (\cos\theta\sin \phi, \sin \theta \sin\phi, \cos\phi) $$

and choose $\theta \sim U[0,2\pi), \phi\sim U[0,\pi]$, from which a random point on the sphere can be selected. But according to this article, the area element of the spherical parameterization is given by $\sin\phi \ d\theta d\phi$. Since this quantity depends on $\phi$ itself, the resulting distribution over the sphere will not be uniform. This I can follow.

The site then suggests a change of coordinates given by $$ (\theta, \phi) = \big(2\pi u, \cos^{-1}(2v-1)\big), \quad \text{where }u,v\sim U(0,1) $$

As far as I understand, the area element using the new $u,v$ coordinate system should be constant (i.e. should not depend on $u,v$). Now the Jacobian of the above transformation is given by $$ J = \begin{bmatrix} 2\pi & 0\\ 0 & \frac{2}{\sqrt{1-(2v-1)^2}} \end{bmatrix} = \begin{bmatrix} 2\pi & 0\\ 0 & \frac{1}{\sqrt{(1-v)v}} \end{bmatrix} $$ so $d\theta d\phi = \det(J) \ dudv$. Finally, we can calculate the new area element $$ \sin\phi \ d\theta d\phi = \sin\cos^{-1}(2v-1)\det(J)\ dudv = 2\pi \sin\cos^{-1}(2v-1)\cdot \frac{1}{\sqrt{(1-v)v}} \ dudv $$

This is clearly dependent on $v$, hence is not constant. Where have I gone wrong? I've spent much time on this but with no progress.

I know that there are very similar questions here and here, but as far as I can tell none of the answers illuminate my question.

  • I think you get samples uniformly distributed on the sphere by generating a vector from the standard normal distribution and normalizing it. And that should work for any dimension. – kaba Nov 25 '23 at 21:39

1 Answers1

2

Well it turns out that nothing I did above is wrong, it's just that I can simplify the above expression even more. Recall the fact that (drawing a picture of the positive half of unit circle really helps here)

$$ \sin \arccos x = \sqrt{1-x^2} $$

From this it follows that

$$ \sin \phi \ d\theta d\phi = 2\pi \sqrt{1-(2v-1)^2}\cdot \frac{1}{\sqrt(1-v)v} \ dudv= 2\pi \cdot 2 \ dudv= 4\pi \ dudv $$

This expression is constant, so the suggested change of variables does in fact work.

  • 2
    Yes, at first it is a bit counterintuitive that the $z$-coordinate (or any other coordinate as well) of a point on the surface of a the unit sphere is uniformly distributed in $[0,1]$, but it is so! The fact that at higher latitudes a change $\Delta\phi$ in the angle results in a smaller change in $z$ (in comparison to the equatorial regions) is exactly compensated by the fact that latitude circles shrink towards the poles. On the other hand, it is not at all surprising that the longitude angle is uniformly distributed in $[0,2\pi]$. After all, we can spin the globe about its axis. – Jyrki Lahtonen Nov 26 '23 at 04:32