Function geo_nd::vector::uniform_dist_sphere3

source ยท
pub fn uniform_dist_sphere3<V: Float>(x: [V; 2], map: bool) -> [V; 3]
Expand description

Generate a unit vector (point on a sphere) uniformly distributed given a [V;2] with each coordinate in the range [0, 1)

This considers the [V;2] as a mapping onto the surface of a cylinder, and wraps that onto the sphere; this works as related by Archimedes.

The mapping here is more complex in that it can map (with rotation+offset) the input vector so that the distribution for uniform input vectors are more evenly spaced across the sphere