chickadee » srfi-27 » random-hollow-sphere!

(make-random-hollow-sphere [mu: (MU 0)] [sigma: (SIGMA 1)] [randoms: (RANDOMS (current-random-real))]) -> (integer -> vector)procedure
(random-hollow-sphere! VECTOR% [mu: (MU 0)] [sigma: (SIGMA 1)] [randoms: (RANDOMS (current-random-real))]) -> vector%procedure

Fills VECTOR% with inexact real random numbers the sum of whose squares are equal to 1.

Thinking of VECTOR% as coordinates in space of dimension N = (vector%-length VECTOR%), the coordinates are uniformly distributed over the surface of the unit n-sphere.

(From Gambit)