RANDSPHERE: RANDOM POINTS ON THE SURFACE OF AN nD SPHERE (Scripts) Publisher's description
from Luigi Giaccari
A few days ago I was in need of uniformly random points generation on the surface of sphere
A few days ago I was in need of uniformly random points generation on the surface of sphere. I suddenly discovered that common parametrization with 2 angles is useless, it gathers too many points in the poles. At MathWorld you can find the complete demonstration, here the main lines:
To pick a random point on the surface of a unit sphere, it is incorrect to select spherical coordinates theta and phi from uniform distributions theta in [0,2pi) and phi in [0,pi], since the area element dOmega=sinphidthetadphi is a function of phi, and hence points picked in this way will be вЂњbunchedвЂќ near the poles (left figure above).
System Requirements:MATLAB 7.8 (R2009a)
Program Release Status: Major Update
Program Install Support: Install and Uninstall