TOPICS
Search

Hypersphere Point Picking


Hypersphere point picking is the selection of points from a uniform distribution on a hypersphere. Marsaglia (1972) gives a simple method for the unit hypersphere S^3 in four-dimensional Euclidean space. Draw two independent pairs (x_1,x_2) and (x_3,x_4) uniformly from the square [-1,1]^2. Resample either pair if its squared distance from the origin is at least 1, and resample the second pair if x_3^2+x_4^2=0. Then the points

x=x_1
(1)
y=x_2
(2)
z=x_3sqrt((1-x_1^2-x_2^2)/(x_3^2+x_4^2))
(3)
w=x_4sqrt((1-x_1^2-x_2^2)/(x_3^2+x_4^2)),
(4)

have a uniform distribution on S^3. This extends Marsaglia's (1972) method for sphere point picking.

For arbitrary dimension, generate independent and identically distributed random variables x_1, x_2, ..., x_n with a standard normal distribution. The normalized vector

 1/(sqrt(x_1^2+x_2^2+...+x_n^2))[x_1; x_2; |; x_n]
(5)

has a uniform distribution on S^(n-1) (Muller 1959, Marsaglia 1972).

Schnabel and Janke (2022, p. 2) give a generalization based on ordered disk samples. For n=2m with m>=1, draw m independent pairs (a_i,b_i) uniformly from the unit disk, rejecting zero radii and boundary points. Sort the whole pairs so that 0<S_1<=...<=S_m<1, where S_i=a_i^2+b_i^2, and set S_0=0. The coordinates

 (X_(2i-1),X_(2i))=(a_i,b_i)sqrt((1-S_(i-1)/S_i)/(S_m))
(6)

for i=1, ..., m give a uniform distribution on S^(2m-1). For odd n, generate a point in n+1 dimensions and normalize its first n coordinates.


See also

Hypersphere, Sphere Point Picking

Explore with Wolfram|Alpha

References

Hicks, J. S. and Wheeling, R. F. "An Efficient Method for Generating Uniformly Distributed Points on the Surface of an n-Dimensional Sphere." Comm. Assoc. Comput. Mach. 2, 13-15, 1959.Marsaglia, G. "Choosing a Point from the Surface of a Sphere." Ann. Math. Stat. 43, 645-646, 1972.Muller, M. E. "A Note on a Method for Generating Points Uniformly on N-Dimensional Spheres." Comm. Assoc. Comput. Mach. 2, 19-20, Apr. 1959.Schnabel, S. and Janke, W. "A Simple Algorithm for Uniform Sampling on the Surface of a Hypersphere." 5 Apr 2022. https://arxiv.org/abs/2204.14004.

Referenced on Wolfram|Alpha

Hypersphere Point Picking

Cite this as:

Weisstein, Eric W. "Hypersphere Point Picking." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/HyperspherePointPicking.html

Subject classifications