Skip to main content

sample_sphere_surface

Function sample_sphere_surface 

Source
pub fn sample_sphere_surface(rng: &mut Lcg) -> [f64; 3]
Expand description

Sample a point uniformly on the surface of the unit sphere (Marsaglia 1972).

Returns [x, y, z] with x² + y² + z² = 1.