Random points on a unit sphere without biasing 2005-06-14 - By Alan Jones
Back Thanks Andy. After looking at the options I think I'm going to go with the one at the bottom of the mathworld page. It suggested 3 gaussian random numbers for X, Y and Z in a vector and normalizing the vector (at least that's what I think it said from my limited math). I managed to track down an apparently fast way to generate gaussian random numbers from evenly distributed ones so with any luck I'm set.
Thanks again,
Alan.
On 6/14/05, Andy Jones <andy@(protected)> wrote: > The mathworld article answers this perfectly. Basically, you pick one > angle (theta) at random and a height (h) on the sphere at random. You > can check this by calculating the approximated surface area (width * > radius) of the bands around the sphere at different heights along the > sphere, and take the limit as dh -> 0. At the poles, the width of the > band is larger for a given height, and at the equator, the radius of the > band is obviously larger. In the limit, they have a perfectly inverse > relationship such that each band has the same area. More generally, a > good way to randomly sample vectors within a given angle of an average > vector is to restrict the height range to [cos(angle), 1]. > > I think you can't pick points in a cube and normalize because you'll > bias more points at the corners and fewer points in the middles of the > faces, since a cube has more and less volume in those directions. The > same problem occurs if you sample on a cube's surface area. The cube > method is especially problematic because the biasing isn't determined by > the original vector direction. Of course, that doesn't mean it doesn't > work okay in practice for many applications. > > -Andy > > Alan Jones wrote: > > >Hi All, > > > >This is to the maths geniuses in the room. I want to generate X number > >of points on a unit sphere, but be sure I won't have any biasing > >involved. > > > >My first thought was just to use a couple of random numbers (let's > >assume they don't have any bias) and then use those with a few sin and > >cos function etc to generate the points. Though I have a feeling that > >would give me more points around the poles. > > > >Anyone have some good suggestions? > > > >Cheers, > > > >Alan. > > > >--- > >Unsubscribe? Mail Majordomo@(protected) with the following text in body: > >unsubscribe xsi > > > > > > > > --- > Unsubscribe? Mail Majordomo@(protected) with the following text in body: > unsubscribe xsi >
--- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|