This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: gsl_rand_dir_3d
After looking at the algorith a while longer I've begun to suspect it has
a more serious flaw than the s==0 condition. If the Z component is
uniformly distributed (since P(x*x+y*y < s | s<=1 ) = s) and the final
vector's orientation in the X-Y plane is also uniform and independent of Z
then the probability of selecting a final vector with -.5<Z<.5 is equal
to the probability of selecting a final vector with -1<=Z<=-.5 or .5<=Z<=1.
Since the surface area of these two sections is not equal but the
probability of selecting a vector in each section is equal, the
distribution cannot be uniform over the surface of the sphere, since the
probability of selecting a vector in any two regions of equal surface
area must be equal in a uniform distribution.
Can someone confirm this?
Stuart