Marsaglia (1972) has given a simple method for selecting points with a uniform distribution on the surface of a 4-sphere. This is accomplished by picking two pairs of points
and
, rejecting
any points for which
and
. Then the points
|
(1)
| |||
|
(2)
| |||
|
(3)
| |||
|
(4)
|
have a uniform distribution on the surface of the hypersphere. This extends the method of Marsaglia (1972) for sphere point picking, but unfortunately does not generalize to higher dimensions.
An easy way to pick a random point on a hypersphere of arbitrary dimension is to generate Gaussian random
variables
,
, ...,
. Then the distribution
of the vectors
|
(5)
|
is uniform over the surface (Muller
1959, Marsaglia 1972).