4 ms·
As an aside, there's an interesting way to generate a uniform distribution on a sphere. It uses the fact that the joint distribution of several independent stan
by OscarCunningham 8y ago
As an aside, there's an interesting way to generate a uniform distribution on a sphere. It uses the fact that the joint distribution of several independent standard Gaussians has rotational symmetry. So to generate a random point on the surface of the n-sphere, you can sample n+1 numbers independently from the standard Gaussian and then normalise them so that their squares sum to 1 (if they're all 0 then you have to reroll).