WEFOUNDA Manual if Spherical and Practical Astronomy Embracing the General Problems of Spherical Astronomy, the Special Applications to Nautical Astronomy, and the Theory and Use of Fixed and Portable Astronomical Instruments. Volume I i Spherical Astronomy

About

A Manual of Spherical and Practical Astronomy

Next: The Weibull Distribution , Previous: The Pareto Distribution , Up: Random Number Distributions [ Index ]

The spherical distributions generate random vectors, located on a
spherical surface. They can be used as random directions, for example in
the steps of a random walk.

This function returns a random direction vector v =
( x , y , z ) in three dimensions. The vector is normalized
such that |v|^2 = x^2 + y^2 + z^2 = 1 . The method employed is
due to Robert E. Knop (CACM 13, 326 (1970)), and explained in Knuth, v2,
3rd ed, p136. It uses the surprising fact that the distribution
projected along any axis is actually uniform (this is only true for 3
dimensions).