Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Uniform distribution on sphere

  1. Jul 6, 2009 #1

    I am trying to make a uniform distribution of points on a sphere. I can find the answer
    [tex]\theta=\pi R_1[/tex]
    [tex]\phi = arccos(1-2R_2)[/tex]

    where R1 and R2 are uniformly distributed random numbers between 0 and 1.

    To me, it feels like
    [tex]\theta=\pi R_1 sin(R1)[/tex]
    [tex]\phi = 2\pi R_2[/tex]
    should also give the correct distribution. Is that the case, and if not how can I understand why not this but the above solution is true? How can I calculate my way to the first answer?

  2. jcsd
  3. Jul 6, 2009 #2
    Well, you want a parametrization x(u,v) : (0,1) x (0,1) -> the unit sphere S2
    such that the unit of area
    [tex]|x_u \times x_v|[/tex]
    is constant, where [tex]\times[/tex] is the cross product.

    It should be simple to verify that this works for the solution given but does not work for your solution. To be more specific, in the solution given,
    x(R1,R2) = s(pi R1, arccos(1-2R2))
    where s is the function for spherical coordinates, i.e. s(theta, phi) = (sin theta cos phi, sin theta sin phi, cos theta)
    Last edited: Jul 6, 2009
  4. Jul 14, 2009 #3
    To write theta and phi in terms of uniforms you first need to find their joint density. Since the points are uniformly distributed over the area, the probability of the rectangle [theta,theta+dt] x [phi,phi+dp] is the proportional to the area on the sphere which is
    the magnitude of the cross product [dx/dtheta] x [dx/dphi] *(dt*dp).

    From this by normalizing you get the joint density f(theta,phi) and integrate to get a marginal density e.g. f(theta) and a conditional density f(phi|theta). The cumulative distribution of any random variable is uniformly distributed, so theta=F^{-1}(R1) and phi=F^{-1}(R2|theta)=F^{-1}(R2|F^{-1}(R1)).

    Hope this helps - what answer do you get from this process?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook