WOLFRAM|DEMONSTRATIONS PROJECT

Random Points on a Sphere

​
randomness method
evenly distributed
spherical coordinates
normalized cartesian
number of points
random seed
There are several ways to pick random points on a sphere. Using points of the form
cos(θ)
1-
2
u
,sin(θ)
1-
2
u
,u
, where
0≤θ≤2π
and
-1≤u≤1
, gives an evenly distributed set of points. Using spherical coordinates,
(cos(θ)sin(ϕ),sin(θ)sin(ϕ),cos(ϕ))
, causes too many points to cluster at the poles. Picking points at random in a cube around the sphere and normalizing,
x
2
x
+
2
y
+
2
z
,
y
2
x
+
2
y
+
2
z
,
z
2
x
+
2
y
+
2
z
, creates too many points that come from the corners of the cube.