How to generate random points on a sphere
rojtberg.net
rojtberg.net
Alternatively you can generate random x, y, and z coordinates between -1 and 1 and toss it if it falls outside of the sphere (i.e. if x^2+y^2+z^2 > 1). Then just renormalized the coordinates so that they fall on the sphere.
The benefit of this is that the method easily generalizes to arbitrary dimension.
I haven't verified it but suspect that you might be able to improve on this by generating the coordinates in order, constantly decreasing the range to ensure that the point falls within the sphere. Then, to ensure spherical symmetry, you randomly shuffle the points at the end.
http://extremelearning.com.au/how-to-generate-uniformly-rand...