Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point? [duplicate] The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to generate random points on a sphere?Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best?How to find a random axis or unit vector in 3D?Picking random points in the volume of sphere with uniform probabilityIs a sphere a closed set?Algorithm to generate random points in n-Sphere?Sampling on Axis-Aligned Spherical QuadRandom 3D points uniformly distributed on an ellipse shaped window of a sphereCompensating for distortion when projecting a 2D texture onto a sphereGenerate Uniformly Random Points on a Transformed SphereFind the relative radial position of a point within an ellipsoidGenerate uniformly distributed points in n-dimensional sphere

Wall plug outlet change

Do working physicists consider Newtonian mechanics to be "falsified"?

How does ice melt when immersed in water?

What do you call a plan that's an alternative plan in case your initial plan fails?

Segmentation fault output is suppressed when piping stdin into a function. Why?

He got a vote 80% that of Emmanuel Macron’s

When did F become S in typeography, and why?

how can a perfect fourth interval be considered either consonant or dissonant?

How can I define good in a religion that claims no moral authority?

Single author papers against my advisor's will?

Why is superheterodyning better than direct conversion?

Windows 10: How to Lock (not sleep) laptop on lid close?

Is there a writing software that you can sort scenes like slides in PowerPoint?

Why does the Event Horizon Telescope (EHT) not include telescopes from Africa, Asia or Australia?

Is every episode of "Where are my Pants?" identical?

Why did all the guest students take carriages to the Yule Ball?

Why is the object placed in the middle of the sentence here?

Can smartphones with the same camera sensor have different image quality?

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

How to test the equality of two Pearson correlation coefficients computed from the same sample?

What's the point in a preamp?

does high air pressure throw off wheel balance?

Was credit for the black hole image misattributed?

The variadic template constructor of my class cannot modify my class members, why is that so?



Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point? [duplicate]



The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)How to generate random points on a sphere?Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best?How to find a random axis or unit vector in 3D?Picking random points in the volume of sphere with uniform probabilityIs a sphere a closed set?Algorithm to generate random points in n-Sphere?Sampling on Axis-Aligned Spherical QuadRandom 3D points uniformly distributed on an ellipse shaped window of a sphereCompensating for distortion when projecting a 2D texture onto a sphereGenerate Uniformly Random Points on a Transformed SphereFind the relative radial position of a point within an ellipsoidGenerate uniformly distributed points in n-dimensional sphere










16












$begingroup$



This question already has an answer here:



  • How to generate random points on a sphere?

    6 answers



The obvious solution of Lattitude & Longitude doesn't work because it generates points more densely near the poles, and the other thing I came up with (Pick a random point in the unit cube, if it's in the sphere map it to the surface, and restart if it's outside) doesn't always find a point within a fixed number of tries.










share|cite|improve this question











$endgroup$



marked as duplicate by Eric Towers, Lord Shark the Unknown, blub, José Carlos Santos, mrtaurho 9 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















  • $begingroup$
    So what you want is a uniform distribution. It would be helpful to state this explicitly.
    $endgroup$
    – robjohn
    2 days ago






  • 6




    $begingroup$
    Distribute longitude uniformly and the sine of the latitude uniformly. Then the distribution of points on the sphere will be uniform.
    $endgroup$
    – robjohn
    2 days ago










  • $begingroup$
    @robjohn thank you, you're right that I forgot to specify that.
    $endgroup$
    – The Zach Man
    2 days ago










  • $begingroup$
    "A uniformly distributed point" is an oxymoron, is it not? If not, then I suggest (r,theta,phi) = (1,0,0), which was drawn from my secret uniform distribution :P
    $endgroup$
    – Marius Ladegård Meyer
    yesterday










  • $begingroup$
    @MariusLadegårdMeyer: okay, I've adjusted the title further. I had tried to make as small a change that would make the uniform distribution clear. Of course, now the idea of a fixed number of random numbers per point is muddied.
    $endgroup$
    – robjohn
    yesterday















16












$begingroup$



This question already has an answer here:



  • How to generate random points on a sphere?

    6 answers



The obvious solution of Lattitude & Longitude doesn't work because it generates points more densely near the poles, and the other thing I came up with (Pick a random point in the unit cube, if it's in the sphere map it to the surface, and restart if it's outside) doesn't always find a point within a fixed number of tries.










share|cite|improve this question











$endgroup$



marked as duplicate by Eric Towers, Lord Shark the Unknown, blub, José Carlos Santos, mrtaurho 9 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















  • $begingroup$
    So what you want is a uniform distribution. It would be helpful to state this explicitly.
    $endgroup$
    – robjohn
    2 days ago






  • 6




    $begingroup$
    Distribute longitude uniformly and the sine of the latitude uniformly. Then the distribution of points on the sphere will be uniform.
    $endgroup$
    – robjohn
    2 days ago










  • $begingroup$
    @robjohn thank you, you're right that I forgot to specify that.
    $endgroup$
    – The Zach Man
    2 days ago










  • $begingroup$
    "A uniformly distributed point" is an oxymoron, is it not? If not, then I suggest (r,theta,phi) = (1,0,0), which was drawn from my secret uniform distribution :P
    $endgroup$
    – Marius Ladegård Meyer
    yesterday










  • $begingroup$
    @MariusLadegårdMeyer: okay, I've adjusted the title further. I had tried to make as small a change that would make the uniform distribution clear. Of course, now the idea of a fixed number of random numbers per point is muddied.
    $endgroup$
    – robjohn
    yesterday













16












16








16


5



$begingroup$



This question already has an answer here:



  • How to generate random points on a sphere?

    6 answers



The obvious solution of Lattitude & Longitude doesn't work because it generates points more densely near the poles, and the other thing I came up with (Pick a random point in the unit cube, if it's in the sphere map it to the surface, and restart if it's outside) doesn't always find a point within a fixed number of tries.










share|cite|improve this question











$endgroup$





This question already has an answer here:



  • How to generate random points on a sphere?

    6 answers



The obvious solution of Lattitude & Longitude doesn't work because it generates points more densely near the poles, and the other thing I came up with (Pick a random point in the unit cube, if it's in the sphere map it to the surface, and restart if it's outside) doesn't always find a point within a fixed number of tries.





This question already has an answer here:



  • How to generate random points on a sphere?

    6 answers







geometry






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited yesterday









robjohn

271k27314643




271k27314643










asked 2 days ago









The Zach ManThe Zach Man

1709




1709




marked as duplicate by Eric Towers, Lord Shark the Unknown, blub, José Carlos Santos, mrtaurho 9 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Eric Towers, Lord Shark the Unknown, blub, José Carlos Santos, mrtaurho 9 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • $begingroup$
    So what you want is a uniform distribution. It would be helpful to state this explicitly.
    $endgroup$
    – robjohn
    2 days ago






  • 6




    $begingroup$
    Distribute longitude uniformly and the sine of the latitude uniformly. Then the distribution of points on the sphere will be uniform.
    $endgroup$
    – robjohn
    2 days ago










  • $begingroup$
    @robjohn thank you, you're right that I forgot to specify that.
    $endgroup$
    – The Zach Man
    2 days ago










  • $begingroup$
    "A uniformly distributed point" is an oxymoron, is it not? If not, then I suggest (r,theta,phi) = (1,0,0), which was drawn from my secret uniform distribution :P
    $endgroup$
    – Marius Ladegård Meyer
    yesterday










  • $begingroup$
    @MariusLadegårdMeyer: okay, I've adjusted the title further. I had tried to make as small a change that would make the uniform distribution clear. Of course, now the idea of a fixed number of random numbers per point is muddied.
    $endgroup$
    – robjohn
    yesterday
















  • $begingroup$
    So what you want is a uniform distribution. It would be helpful to state this explicitly.
    $endgroup$
    – robjohn
    2 days ago






  • 6




    $begingroup$
    Distribute longitude uniformly and the sine of the latitude uniformly. Then the distribution of points on the sphere will be uniform.
    $endgroup$
    – robjohn
    2 days ago










  • $begingroup$
    @robjohn thank you, you're right that I forgot to specify that.
    $endgroup$
    – The Zach Man
    2 days ago










  • $begingroup$
    "A uniformly distributed point" is an oxymoron, is it not? If not, then I suggest (r,theta,phi) = (1,0,0), which was drawn from my secret uniform distribution :P
    $endgroup$
    – Marius Ladegård Meyer
    yesterday










  • $begingroup$
    @MariusLadegårdMeyer: okay, I've adjusted the title further. I had tried to make as small a change that would make the uniform distribution clear. Of course, now the idea of a fixed number of random numbers per point is muddied.
    $endgroup$
    – robjohn
    yesterday















$begingroup$
So what you want is a uniform distribution. It would be helpful to state this explicitly.
$endgroup$
– robjohn
2 days ago




$begingroup$
So what you want is a uniform distribution. It would be helpful to state this explicitly.
$endgroup$
– robjohn
2 days ago




6




6




$begingroup$
Distribute longitude uniformly and the sine of the latitude uniformly. Then the distribution of points on the sphere will be uniform.
$endgroup$
– robjohn
2 days ago




$begingroup$
Distribute longitude uniformly and the sine of the latitude uniformly. Then the distribution of points on the sphere will be uniform.
$endgroup$
– robjohn
2 days ago












$begingroup$
@robjohn thank you, you're right that I forgot to specify that.
$endgroup$
– The Zach Man
2 days ago




$begingroup$
@robjohn thank you, you're right that I forgot to specify that.
$endgroup$
– The Zach Man
2 days ago












$begingroup$
"A uniformly distributed point" is an oxymoron, is it not? If not, then I suggest (r,theta,phi) = (1,0,0), which was drawn from my secret uniform distribution :P
$endgroup$
– Marius Ladegård Meyer
yesterday




$begingroup$
"A uniformly distributed point" is an oxymoron, is it not? If not, then I suggest (r,theta,phi) = (1,0,0), which was drawn from my secret uniform distribution :P
$endgroup$
– Marius Ladegård Meyer
yesterday












$begingroup$
@MariusLadegårdMeyer: okay, I've adjusted the title further. I had tried to make as small a change that would make the uniform distribution clear. Of course, now the idea of a fixed number of random numbers per point is muddied.
$endgroup$
– robjohn
yesterday




$begingroup$
@MariusLadegårdMeyer: okay, I've adjusted the title further. I had tried to make as small a change that would make the uniform distribution clear. Of course, now the idea of a fixed number of random numbers per point is muddied.
$endgroup$
– robjohn
yesterday










5 Answers
5






active

oldest

votes


















32












$begingroup$

The Lambert cylindrical equal area projection maps the sphere to a cylinder, area to equal area. It is easy to generate a uniform distribution on a cylinder. Simply map it back to the sphere.



For $(u_1,u_2)$ uniform on $[0,1]^2$, either



$mathrmlat=arcsin(2u_1-1),mathrmlon=2pi u_2$



or



$z=2u_1-1,x=sqrt1-z^2cos(2pi u_2),y=sqrt1-z^2sin(2pi u_2)$






share|cite|improve this answer









$endgroup$




















    19












    $begingroup$

    Your method, even though it doesn't finish in a fixed number of times, is a reasonable way to do it. Each trial succeeds with probability $fracpi6$, which is better than $frac12$: the average number of trials is less than $2$.



    Another standard method is to use the normal distribution. Generate $x, y, z$ independently from a standard normal distribution, then take the point $(x,y,z)$ and divide it by $sqrtx^2+y^2+z^2$ as you did for points inside the cube. The multivariate normal distribution is rotationally symmetric, so this will get you evenly distributed points on the sphere.



    (The Box–Muller transform is one way to generate normally distributed random numbers, and some versions of it do not use rejection sampling, so they can be done with a "fixed amount" of randomness.)






    share|cite|improve this answer









    $endgroup$




















      5












      $begingroup$


      Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?




      This Stack Overflow answer mentions the Fibonacci sphere algorithm, and the currently unanswered Math SE question Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best? contains several excellent links in the question and in comments.



      The method is deterministic, using either zero or one random number, no matter the number of points generated.



      Florida State University's John Burkardt's web page Fibonacci Spiral Grid on a Sphere provides some references and examples of code implementations.




      Edward Saff, Arno Kuijlaars,
      Distributing Many Points on a Sphere,
      The Mathematical Intelligencer,
      Volume 19, Number 1, 1997, pages 5-11.



      Richard Swinbank, James Purser,
      Fibonacci grids: A novel approach to global modelling,
      Quarterly Journal of the Royal Meteorological Society,
      Volume 132, Number 619, July 2006 Part B, pages 1769-1793.




      Extreme Learning's Evenly distributing points on a sphere addresses several criteria for judging the level of uniformity provided by different solutions, and describes the process of first generating a Fibonacci grid and then transforming it to a sphere.




      An example of these Fibonacci Grids is shown below. These points sets can be transformed to a well-known Fibonacci spirals via the transformation




      enter image description here



      I can't be sure it will be sufficiently uniform for you, but it certainly looks nice!



      enter image description here Source






      share|cite|improve this answer











      $endgroup$




















        4












        $begingroup$

        You can still use the longitude/latitude method. You just need to transform the latitude such that the probability of falling in any given latitude band is proportional to its surface area.



        The length of the circumference at a latitude, l, is proportional to cos(l). (0 at -90 degrees, max at the equator, 0 at +90 degrees). Therefore, by integrating we know that the total surface area between any two latitudes, l1 and l2, is proportional to sin(l2) - sin(l1).



        By inverting that, we arrive at a formula for transforming a [0, 1] uniform random variable (X) into a latitude such that any point on the sphere is equally likely to be selected:



        latitude = arcsin(2X - 1)





        share|cite|improve this answer








        New contributor




        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        $endgroup$




















          0












          $begingroup$

          Your second method can be improved in this way: Select the three coordinates (x, y, z) in a linear distribution from -1 to 1.



          If (y * y + z * z) > 1, select replacements for these two only. (You will only have to re-roll them 4-pi/4 (roughly 21.4%) of the time; average random numbers used is 1 + 8/pi = ~ 3.546.



          Keep x as it is, scale both y and z by sqrt((1 - x * x)/(y * y + z * z)).






          share|cite|improve this answer








          New contributor




          EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          $endgroup$



















            5 Answers
            5






            active

            oldest

            votes








            5 Answers
            5






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            32












            $begingroup$

            The Lambert cylindrical equal area projection maps the sphere to a cylinder, area to equal area. It is easy to generate a uniform distribution on a cylinder. Simply map it back to the sphere.



            For $(u_1,u_2)$ uniform on $[0,1]^2$, either



            $mathrmlat=arcsin(2u_1-1),mathrmlon=2pi u_2$



            or



            $z=2u_1-1,x=sqrt1-z^2cos(2pi u_2),y=sqrt1-z^2sin(2pi u_2)$






            share|cite|improve this answer









            $endgroup$

















              32












              $begingroup$

              The Lambert cylindrical equal area projection maps the sphere to a cylinder, area to equal area. It is easy to generate a uniform distribution on a cylinder. Simply map it back to the sphere.



              For $(u_1,u_2)$ uniform on $[0,1]^2$, either



              $mathrmlat=arcsin(2u_1-1),mathrmlon=2pi u_2$



              or



              $z=2u_1-1,x=sqrt1-z^2cos(2pi u_2),y=sqrt1-z^2sin(2pi u_2)$






              share|cite|improve this answer









              $endgroup$















                32












                32








                32





                $begingroup$

                The Lambert cylindrical equal area projection maps the sphere to a cylinder, area to equal area. It is easy to generate a uniform distribution on a cylinder. Simply map it back to the sphere.



                For $(u_1,u_2)$ uniform on $[0,1]^2$, either



                $mathrmlat=arcsin(2u_1-1),mathrmlon=2pi u_2$



                or



                $z=2u_1-1,x=sqrt1-z^2cos(2pi u_2),y=sqrt1-z^2sin(2pi u_2)$






                share|cite|improve this answer









                $endgroup$



                The Lambert cylindrical equal area projection maps the sphere to a cylinder, area to equal area. It is easy to generate a uniform distribution on a cylinder. Simply map it back to the sphere.



                For $(u_1,u_2)$ uniform on $[0,1]^2$, either



                $mathrmlat=arcsin(2u_1-1),mathrmlon=2pi u_2$



                or



                $z=2u_1-1,x=sqrt1-z^2cos(2pi u_2),y=sqrt1-z^2sin(2pi u_2)$







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered 2 days ago









                robjohnrobjohn

                271k27314643




                271k27314643





















                    19












                    $begingroup$

                    Your method, even though it doesn't finish in a fixed number of times, is a reasonable way to do it. Each trial succeeds with probability $fracpi6$, which is better than $frac12$: the average number of trials is less than $2$.



                    Another standard method is to use the normal distribution. Generate $x, y, z$ independently from a standard normal distribution, then take the point $(x,y,z)$ and divide it by $sqrtx^2+y^2+z^2$ as you did for points inside the cube. The multivariate normal distribution is rotationally symmetric, so this will get you evenly distributed points on the sphere.



                    (The Box–Muller transform is one way to generate normally distributed random numbers, and some versions of it do not use rejection sampling, so they can be done with a "fixed amount" of randomness.)






                    share|cite|improve this answer









                    $endgroup$

















                      19












                      $begingroup$

                      Your method, even though it doesn't finish in a fixed number of times, is a reasonable way to do it. Each trial succeeds with probability $fracpi6$, which is better than $frac12$: the average number of trials is less than $2$.



                      Another standard method is to use the normal distribution. Generate $x, y, z$ independently from a standard normal distribution, then take the point $(x,y,z)$ and divide it by $sqrtx^2+y^2+z^2$ as you did for points inside the cube. The multivariate normal distribution is rotationally symmetric, so this will get you evenly distributed points on the sphere.



                      (The Box–Muller transform is one way to generate normally distributed random numbers, and some versions of it do not use rejection sampling, so they can be done with a "fixed amount" of randomness.)






                      share|cite|improve this answer









                      $endgroup$















                        19












                        19








                        19





                        $begingroup$

                        Your method, even though it doesn't finish in a fixed number of times, is a reasonable way to do it. Each trial succeeds with probability $fracpi6$, which is better than $frac12$: the average number of trials is less than $2$.



                        Another standard method is to use the normal distribution. Generate $x, y, z$ independently from a standard normal distribution, then take the point $(x,y,z)$ and divide it by $sqrtx^2+y^2+z^2$ as you did for points inside the cube. The multivariate normal distribution is rotationally symmetric, so this will get you evenly distributed points on the sphere.



                        (The Box–Muller transform is one way to generate normally distributed random numbers, and some versions of it do not use rejection sampling, so they can be done with a "fixed amount" of randomness.)






                        share|cite|improve this answer









                        $endgroup$



                        Your method, even though it doesn't finish in a fixed number of times, is a reasonable way to do it. Each trial succeeds with probability $fracpi6$, which is better than $frac12$: the average number of trials is less than $2$.



                        Another standard method is to use the normal distribution. Generate $x, y, z$ independently from a standard normal distribution, then take the point $(x,y,z)$ and divide it by $sqrtx^2+y^2+z^2$ as you did for points inside the cube. The multivariate normal distribution is rotationally symmetric, so this will get you evenly distributed points on the sphere.



                        (The Box–Muller transform is one way to generate normally distributed random numbers, and some versions of it do not use rejection sampling, so they can be done with a "fixed amount" of randomness.)







                        share|cite|improve this answer












                        share|cite|improve this answer



                        share|cite|improve this answer










                        answered 2 days ago









                        Misha LavrovMisha Lavrov

                        49.3k757108




                        49.3k757108





















                            5












                            $begingroup$


                            Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?




                            This Stack Overflow answer mentions the Fibonacci sphere algorithm, and the currently unanswered Math SE question Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best? contains several excellent links in the question and in comments.



                            The method is deterministic, using either zero or one random number, no matter the number of points generated.



                            Florida State University's John Burkardt's web page Fibonacci Spiral Grid on a Sphere provides some references and examples of code implementations.




                            Edward Saff, Arno Kuijlaars,
                            Distributing Many Points on a Sphere,
                            The Mathematical Intelligencer,
                            Volume 19, Number 1, 1997, pages 5-11.



                            Richard Swinbank, James Purser,
                            Fibonacci grids: A novel approach to global modelling,
                            Quarterly Journal of the Royal Meteorological Society,
                            Volume 132, Number 619, July 2006 Part B, pages 1769-1793.




                            Extreme Learning's Evenly distributing points on a sphere addresses several criteria for judging the level of uniformity provided by different solutions, and describes the process of first generating a Fibonacci grid and then transforming it to a sphere.




                            An example of these Fibonacci Grids is shown below. These points sets can be transformed to a well-known Fibonacci spirals via the transformation




                            enter image description here



                            I can't be sure it will be sufficiently uniform for you, but it certainly looks nice!



                            enter image description here Source






                            share|cite|improve this answer











                            $endgroup$

















                              5












                              $begingroup$


                              Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?




                              This Stack Overflow answer mentions the Fibonacci sphere algorithm, and the currently unanswered Math SE question Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best? contains several excellent links in the question and in comments.



                              The method is deterministic, using either zero or one random number, no matter the number of points generated.



                              Florida State University's John Burkardt's web page Fibonacci Spiral Grid on a Sphere provides some references and examples of code implementations.




                              Edward Saff, Arno Kuijlaars,
                              Distributing Many Points on a Sphere,
                              The Mathematical Intelligencer,
                              Volume 19, Number 1, 1997, pages 5-11.



                              Richard Swinbank, James Purser,
                              Fibonacci grids: A novel approach to global modelling,
                              Quarterly Journal of the Royal Meteorological Society,
                              Volume 132, Number 619, July 2006 Part B, pages 1769-1793.




                              Extreme Learning's Evenly distributing points on a sphere addresses several criteria for judging the level of uniformity provided by different solutions, and describes the process of first generating a Fibonacci grid and then transforming it to a sphere.




                              An example of these Fibonacci Grids is shown below. These points sets can be transformed to a well-known Fibonacci spirals via the transformation




                              enter image description here



                              I can't be sure it will be sufficiently uniform for you, but it certainly looks nice!



                              enter image description here Source






                              share|cite|improve this answer











                              $endgroup$















                                5












                                5








                                5





                                $begingroup$


                                Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?




                                This Stack Overflow answer mentions the Fibonacci sphere algorithm, and the currently unanswered Math SE question Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best? contains several excellent links in the question and in comments.



                                The method is deterministic, using either zero or one random number, no matter the number of points generated.



                                Florida State University's John Burkardt's web page Fibonacci Spiral Grid on a Sphere provides some references and examples of code implementations.




                                Edward Saff, Arno Kuijlaars,
                                Distributing Many Points on a Sphere,
                                The Mathematical Intelligencer,
                                Volume 19, Number 1, 1997, pages 5-11.



                                Richard Swinbank, James Purser,
                                Fibonacci grids: A novel approach to global modelling,
                                Quarterly Journal of the Royal Meteorological Society,
                                Volume 132, Number 619, July 2006 Part B, pages 1769-1793.




                                Extreme Learning's Evenly distributing points on a sphere addresses several criteria for judging the level of uniformity provided by different solutions, and describes the process of first generating a Fibonacci grid and then transforming it to a sphere.




                                An example of these Fibonacci Grids is shown below. These points sets can be transformed to a well-known Fibonacci spirals via the transformation




                                enter image description here



                                I can't be sure it will be sufficiently uniform for you, but it certainly looks nice!



                                enter image description here Source






                                share|cite|improve this answer











                                $endgroup$




                                Is there a way to generate uniformly distributed points on a sphere from a fixed amount of random real numbers per point?




                                This Stack Overflow answer mentions the Fibonacci sphere algorithm, and the currently unanswered Math SE question Is the Fibonacci lattice the very best way to evenly distribute N points on a sphere? So far it seems that it is the best? contains several excellent links in the question and in comments.



                                The method is deterministic, using either zero or one random number, no matter the number of points generated.



                                Florida State University's John Burkardt's web page Fibonacci Spiral Grid on a Sphere provides some references and examples of code implementations.




                                Edward Saff, Arno Kuijlaars,
                                Distributing Many Points on a Sphere,
                                The Mathematical Intelligencer,
                                Volume 19, Number 1, 1997, pages 5-11.



                                Richard Swinbank, James Purser,
                                Fibonacci grids: A novel approach to global modelling,
                                Quarterly Journal of the Royal Meteorological Society,
                                Volume 132, Number 619, July 2006 Part B, pages 1769-1793.




                                Extreme Learning's Evenly distributing points on a sphere addresses several criteria for judging the level of uniformity provided by different solutions, and describes the process of first generating a Fibonacci grid and then transforming it to a sphere.




                                An example of these Fibonacci Grids is shown below. These points sets can be transformed to a well-known Fibonacci spirals via the transformation




                                enter image description here



                                I can't be sure it will be sufficiently uniform for you, but it certainly looks nice!



                                enter image description here Source







                                share|cite|improve this answer














                                share|cite|improve this answer



                                share|cite|improve this answer








                                edited yesterday

























                                answered yesterday









                                uhohuhoh

                                6571718




                                6571718





















                                    4












                                    $begingroup$

                                    You can still use the longitude/latitude method. You just need to transform the latitude such that the probability of falling in any given latitude band is proportional to its surface area.



                                    The length of the circumference at a latitude, l, is proportional to cos(l). (0 at -90 degrees, max at the equator, 0 at +90 degrees). Therefore, by integrating we know that the total surface area between any two latitudes, l1 and l2, is proportional to sin(l2) - sin(l1).



                                    By inverting that, we arrive at a formula for transforming a [0, 1] uniform random variable (X) into a latitude such that any point on the sphere is equally likely to be selected:



                                    latitude = arcsin(2X - 1)





                                    share|cite|improve this answer








                                    New contributor




                                    user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                    Check out our Code of Conduct.






                                    $endgroup$

















                                      4












                                      $begingroup$

                                      You can still use the longitude/latitude method. You just need to transform the latitude such that the probability of falling in any given latitude band is proportional to its surface area.



                                      The length of the circumference at a latitude, l, is proportional to cos(l). (0 at -90 degrees, max at the equator, 0 at +90 degrees). Therefore, by integrating we know that the total surface area between any two latitudes, l1 and l2, is proportional to sin(l2) - sin(l1).



                                      By inverting that, we arrive at a formula for transforming a [0, 1] uniform random variable (X) into a latitude such that any point on the sphere is equally likely to be selected:



                                      latitude = arcsin(2X - 1)





                                      share|cite|improve this answer








                                      New contributor




                                      user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                      Check out our Code of Conduct.






                                      $endgroup$















                                        4












                                        4








                                        4





                                        $begingroup$

                                        You can still use the longitude/latitude method. You just need to transform the latitude such that the probability of falling in any given latitude band is proportional to its surface area.



                                        The length of the circumference at a latitude, l, is proportional to cos(l). (0 at -90 degrees, max at the equator, 0 at +90 degrees). Therefore, by integrating we know that the total surface area between any two latitudes, l1 and l2, is proportional to sin(l2) - sin(l1).



                                        By inverting that, we arrive at a formula for transforming a [0, 1] uniform random variable (X) into a latitude such that any point on the sphere is equally likely to be selected:



                                        latitude = arcsin(2X - 1)





                                        share|cite|improve this answer








                                        New contributor




                                        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                        Check out our Code of Conduct.






                                        $endgroup$



                                        You can still use the longitude/latitude method. You just need to transform the latitude such that the probability of falling in any given latitude band is proportional to its surface area.



                                        The length of the circumference at a latitude, l, is proportional to cos(l). (0 at -90 degrees, max at the equator, 0 at +90 degrees). Therefore, by integrating we know that the total surface area between any two latitudes, l1 and l2, is proportional to sin(l2) - sin(l1).



                                        By inverting that, we arrive at a formula for transforming a [0, 1] uniform random variable (X) into a latitude such that any point on the sphere is equally likely to be selected:



                                        latitude = arcsin(2X - 1)






                                        share|cite|improve this answer








                                        New contributor




                                        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                        Check out our Code of Conduct.









                                        share|cite|improve this answer



                                        share|cite|improve this answer






                                        New contributor




                                        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                        Check out our Code of Conduct.









                                        answered yesterday









                                        user79126user79126

                                        411




                                        411




                                        New contributor




                                        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                        Check out our Code of Conduct.





                                        New contributor





                                        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                        Check out our Code of Conduct.






                                        user79126 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                        Check out our Code of Conduct.





















                                            0












                                            $begingroup$

                                            Your second method can be improved in this way: Select the three coordinates (x, y, z) in a linear distribution from -1 to 1.



                                            If (y * y + z * z) > 1, select replacements for these two only. (You will only have to re-roll them 4-pi/4 (roughly 21.4%) of the time; average random numbers used is 1 + 8/pi = ~ 3.546.



                                            Keep x as it is, scale both y and z by sqrt((1 - x * x)/(y * y + z * z)).






                                            share|cite|improve this answer








                                            New contributor




                                            EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                            Check out our Code of Conduct.






                                            $endgroup$

















                                              0












                                              $begingroup$

                                              Your second method can be improved in this way: Select the three coordinates (x, y, z) in a linear distribution from -1 to 1.



                                              If (y * y + z * z) > 1, select replacements for these two only. (You will only have to re-roll them 4-pi/4 (roughly 21.4%) of the time; average random numbers used is 1 + 8/pi = ~ 3.546.



                                              Keep x as it is, scale both y and z by sqrt((1 - x * x)/(y * y + z * z)).






                                              share|cite|improve this answer








                                              New contributor




                                              EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                              Check out our Code of Conduct.






                                              $endgroup$















                                                0












                                                0








                                                0





                                                $begingroup$

                                                Your second method can be improved in this way: Select the three coordinates (x, y, z) in a linear distribution from -1 to 1.



                                                If (y * y + z * z) > 1, select replacements for these two only. (You will only have to re-roll them 4-pi/4 (roughly 21.4%) of the time; average random numbers used is 1 + 8/pi = ~ 3.546.



                                                Keep x as it is, scale both y and z by sqrt((1 - x * x)/(y * y + z * z)).






                                                share|cite|improve this answer








                                                New contributor




                                                EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                Check out our Code of Conduct.






                                                $endgroup$



                                                Your second method can be improved in this way: Select the three coordinates (x, y, z) in a linear distribution from -1 to 1.



                                                If (y * y + z * z) > 1, select replacements for these two only. (You will only have to re-roll them 4-pi/4 (roughly 21.4%) of the time; average random numbers used is 1 + 8/pi = ~ 3.546.



                                                Keep x as it is, scale both y and z by sqrt((1 - x * x)/(y * y + z * z)).







                                                share|cite|improve this answer








                                                New contributor




                                                EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                Check out our Code of Conduct.









                                                share|cite|improve this answer



                                                share|cite|improve this answer






                                                New contributor




                                                EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                Check out our Code of Conduct.









                                                answered yesterday









                                                EvilSnackEvilSnack

                                                1012




                                                1012




                                                New contributor




                                                EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                Check out our Code of Conduct.





                                                New contributor





                                                EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                Check out our Code of Conduct.






                                                EvilSnack is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                                                Check out our Code of Conduct.













                                                    Popular posts from this blog

                                                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                                                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                                                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form