I am trying to generate random points on the surface of the sphere using numpy. I have reviewed the post that explains uniform distribution here. However, need ideas on how
(edited to reflect corrections from comments)
i investigated a few constant time approaches to this problem in 2004.
assuming you're working in spherical coordinates where theta is the angle around the vertical axis (eg longitude) and phi is the angle raised up from the equator (eg latitude),
then to obtain a uniform distribution of random points on the hemisphere north of the equator you do this:
theta = rand(0, 360).phi = 90 * (1 - sqrt(rand(0, 1))).to get points on a sphere instead of a hemisphere, then simply negate phi 50% of the time.
for the curious, a similar approach holds for generating uniformly-distributed points on a unit-disk:
theta = rand(0, 360).radius = sqrt(rand(0, 1)).i do not have proofs for the correctness of these approaches, but i've used them with lots of success over the past decade or so, and am convinced of their correctness.
some illustration (from 2004) of the various approaches is here, including a visualization of the approach of choosing points on the surface of a cube and normalizing them onto the sphere.