Opened 13 years ago

Closed 13 years ago

#347 deleted Bugs (None)

boost::uniform_on_sphere in not uniform on sphere

Reported by: usu_acm Owned by: jmaurer
Milestone: Component: random
Version: None Severity:
Keywords: Cc:


It's clear that your previous (1.29) and current verisons 
(1.32) has no really uniform point distribution on sphere. 

This fact can be proved by observation that 
distributions of all coordinates are independent on each 

For example for 3D-sphere really uniform distribution is 
given by Euler angles (x, arcsin(2t - 1)), where x is 
uniformly distributed random value on [0..2*pi].

Attachments (0)

Change History (2)

comment:1 Changed 13 years ago by nobody

Logged In: NO 

it is correct that each coordinate is selected independently, 
but with a normal distribution.

(warning: the following is a little fast and loose)

for a normal distribution, the probability of landing at x will be 

if you use the same distrubution for y and z, the probability of 
landing at (x,y,z) will thus be:
a^(-b*x^2) * a^(-b*y^2) * a^(-b*z^2) = 

you can recognize the latter as:
a^(-b*l^2), where l = length(x,y,z)

in other words, the probability of landing at (x,y,z) is only a 
function of the *length* of (x,y,z), i.e. it is unrelated to the 
*direction* of (x,y,z)

btw, mathworld has a great page on this subject:

/michael toksvig

comment:2 Changed 13 years ago by usu_acm

Status: assignedclosed
Logged In: YES 

To: nobody.
Perfect! thnx a lot!

Modify Ticket

Change Properties
Set your email in Preferences
as deleted The owner will remain jmaurer.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.