Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!samsung!noose.ecn.purdue.edu!newton.physics.purdue.edu!cca From: cca@newton.physics.purdue.edu (Charles C. Allen) Newsgroups: comp.graphics Subject: Re: random points on surface of sphere Summary: communication is easier if people use standard notation... Keywords: uniform spherical distribution, random walk Message-ID: <3675@newton.physics.purdue.edu> Date: 9 May 90 04:39:12 GMT References: <1523@ryn.esg.dec.com+ <40768@apple.Apple.COM> <1220@med.Stanford.EDU> <13955@cgl.ucsf.EDU> Organization: Purdue Univ. Physics Dept, W.Lafayette, IN Lines: 20 > 1) pick theta randomly between -pi and pi > 2) pick z randomly between -R and R The above method (azimuthal angle between -pi and pi, z between -R and R) works fine, but it does not save you a trig function call unless that's all you need. You have one arccos call if you want the polar angle, and at least one more plus some square roots if you want the (x,y,z) triple. Which method is "fastest" depends not only on what hardware you have, but also what you want for a final result. [Minor personal note - every single math & physics text I have uses theta for the polar angle and phi for the azimuthal angle when discussing spherical coordinates. Perhaps my brain has calcified, but it *is* a little disconcerting to realize that a posting isn't making sense because someone is using a different notation.] Charles Allen Internet: cca@newton.physics.purdue.edu Department of Physics HEPnet: purdnu::allen, fnal::cca Purdue University talknet: 317/494-9776 West Lafayette, IN 47907