I guess Gene's explanation is probably the main reason that the Gaussian algorithm is the one that gets used, mostly. It's too bad that generating Gaussian samples is so clunky. Sqrt(-2 ln U) cis V, indeed. On Thu, Jul 25, 2019 at 3:11 PM Eugene Salamin via math-fun < math-fun@mailman.xmission.com> wrote:
This method relies on the theorem that slices of a sphere of equal thickness have equal area. But this algorithm has a problem that sqrt(1-z^2) has large large relative error when z is near 1 or -1. If I were generating random points on the sphere, I'd use the Gaussian algorithm, and it would work in any dimension.
-- Gene
On Thursday, July 25, 2019, 12:00:42 PM PDT, Cris Moore < moore@santafe.edu> wrote:
Indeed, the following generates uniform points on the unit sphere, where “uniform” means that each bit of area has the right amount of probability:
. choose z uniformly in [-1,+1] . choose phi uniformly in [0,2pi] . set x=sqrt(1-z^2) cos phi and y=sqrt(1-z^2) sin phi
It’s a very nice exercise. Basically the way the circumference of the circle of latitude decreases as z moves away from zero is exactly compensated for by the way the area of a bit of surface of height dz increases as it tilts from vertical to horizontal. Try it!
- Cris
On Jul 25, 2019, at 12:10 PM, Allan Wechsler <acwacw@gmail.com> wrote:
Is it really true that the z coordinate is uniformly distributed?
A really common question is, "What's the right way to generate pseudo random points on the surface of a sphere?" The most common answer, and the only one I know offhand, is, "Generate three Gaussian coordinate and normalize.". Why have I never heard, "Generate a uniform z coordinate and a uniform azimuth."?
On Thu, Jul 25, 2019, 1:47 PM Cris Moore <moore@santafe.edu> wrote:
This reminds me of the lovely fact (mentioned before on this forum)
that a
random point on a sphere of radius r has a _uniformly_ random z-coordinate from +r to –r. (This is true only in 3 dimensions.)
- Cris
On Jul 25, 2019, at 8:30 AM, Veit Elser <ve10@cornell.edu> wrote:
Jim,
Strogatz did quite a bit of research on this for his recent book (pre-calculus ideas). I would first look there.
-Veit
On Jul 25, 2019, at 7:25 AM, James Propp <jamespropp@gmail.com> wrote:
One can prove that the expected distance from a random point on the surface of a sphere to the equatorial plane is half the radius. Assuming we could rephrase this claim in a form that Archimedes would recognize, how would he have proved it?
As an example of the kind of proof I would like to see, consider the proposition that the expected distance from a random point in a disk to the boundary of the disk is 1/3 of the radius. One can prove this using the formula for the volume of a cone. (I came up with this myself but I’m sure others have too.)
Further examples of the kind of proof I have in mind are Archimedes’ determination of the surface area and volume of the sphere.
Jim Propp
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com https://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun