2D and 3D distributions Random 2D vector in a circle When writing procedural generation systems it is often desirable to be able to generate a 2D or 3D vector that falls uniformly within a circle or sphere. That is to say the vectors direction is random, and its magnitude ranges from (0.0, 1.f]. This can be useful for applications such as random sampling around a point, making random walks and stochastic approximations like ambient occlusion.
74