This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gsl_rand_dir_3d


On Mon, 4 Aug 2003, Stuart O Anderson wrote:

] 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
]

Actually, I believe the surface areas of the two regions you describe
*are* equal.  This is at first a little counter-intuitive, but you
should work it out.  The region near the equator seems to have larger
area because it is farther from the axis, but the region around the
poles has an extra cosine effect which makes up for this.  Hard to
describe without a picture, but if you try to work it out, I think
you'll see what I'm talking about.

jt

---------------------------------------------
James Theiler                     jt@lanl.gov
MS-B244, NIS-2, LANL        tel: 505/665-5682
Los Alamos, NM 87545        fax: 505/665-4414
----- Space and Remote Sensing Sciences -----



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]