From casida@CHIMCN.UMontreal.CA Sun Dec 6 06:01:10 1992 From: casida@CHIMCN.UMontreal.CA (Casida Mark) Message-Id: <9212061601.AA07791@chims1.CHIMCN.UMontreal.CA> Subject: uniform random distribution on sphere To: chemistry@ccl.net Date: Sun, 6 Dec 92 11:01:10 EST Since the following question seems to have stimulated a significant amount of interest on the list, I thought I'd just mention an old trick I happen to know for solving the classic problem of generating uniformly distributed random points on the surface of a sphere. I recall getting this from the (math?) literature many years ago, but have lost the reference. > Hi fellow chemists, > This may fit better in comp.graphics, but someone in this group > may have experienced it already. So here it goes. > I want to generate points on the surface of a sphere as randomly > as possible. These points may be used for drawing van der Waals > surface of an atom. I tried with symmetrically distributed points > (generated by varying phi and theta, etc), but due to symmetry, > the points looked like marching ants at certain angles. > Since many of symmetrically distributed points are likely to be > overlapped when they are placed in 2-D screen, increasing the > density of VDW points would require unnecessarily large number > of sphere points. Random distribution of points would help > minimizing the number of points required and will give a better > appearance. > Any ideas? > -DCL > lim@rani.chem.yale.edu The best solution I know (and one which works well when adopted to N-dimensions!) is to generate (x,y,z) points with a Gaussian random distribution in each coordinate. This gives you a spherically symmetric 3-dimensional distribution which you can then project radially onto the surface of a sphere of radius R: r^2 = x^2 + y^2 + z^2 (x,y,z) -> (R/r)*(x,y,z) Gaussian random number generators are widely available. Mark E. Casida casida@chimcn.umontreal.ca From lim@rani.chem.yale.edu Sun Dec 6 14:44:00 1992 From: Dongchul Lim Message-Id: <9212070044.AA25730@rani.chem.yale.edu> Subject: Distribution of Points on a Sphere (from the poster) To: chemistry@ccl.net (Computational Chemistry) Date: Sun, 6 Dec 92 19:44:00 EST Dear netters, I'm the one who posted an article about random distribution of points on the surface of a sphere. As of today, I received about 30 responses (inclding the articles posted on the mailing list) >from all over the world. I thank all who sent me valuable suggestions. I keep a compilation of this thread and am willing to send it to anyone who is interested. Many people suggested polygon approximation of sphere by recursive subdivision, which can be found in comp.graphics FAQ list. Triangle meshes generated by this method are good for drawing solid spheres, wire frame spheres, or whatever (most graphics library routines work that way), but this always gives the fixed number of points for a given level. Another group of people suggested (sort of) world-globe method, where z value is fixed and theta and phi are chosen randomly between 0 and 360 for a given number of times. Problem is that points get dense around the poles and sparse around the equator. Others mentioned Allen and Tildesley's book (algorithm in the appendix gives uniform distribution of points) or projection of random points to the surface of a sphere. Anyway, just for a reminder, what I meant in the article was 1. the numbe of points per unit surface area of a sphere (i.e., density) must be constant. 2. these points must be randomly located. Send me a mail if you want all replies. -DCL lim@rani.chem.yale.edu From lim@rani.chem.yale.edu Sun Dec 6 14:52:25 1992 From: Dongchul Lim Message-Id: <9212070052.AA25740@rani.chem.yale.edu> Subject: Re: Distribution of Points on a Sphere (from the poster) To: chemistry@ccl.net (Computational Chemistry) Date: Sun, 6 Dec 92 19:52:25 EST lim writes: > 1. the numbe of points per unit surface area of a sphere (i.e., > density) must be constant. > 2. these points must be randomly located. > These two things sound the same, but to get a random distribution with the same density regardless of the radius of a sphere, these two conditions are necessary, I think. -DCL