The plotting is quite painful, so here's a cleaner, faster version (credit HYRY credit HYRY):
The plotting is quite painful, so here's a cleaner, faster version (credit HYRY):
The plotting is quite painful, so here's a cleaner, faster version (credit HYRY):
Thanks to Michael Hardy for that explanation that explanation.
Thanks to Michael Hardy for that explanation.
Thanks to Michael Hardy for that explanation.
Instead, generate the original points with a normal distribution. I'm not sure how to explain
This is because the result intuitivelystandard normal distribution has a probability density function of
$$ \phi(x) = \frac{1}{\sqrt{2\pi}}\exp\left(-x^2/2\right) $$
so a 2D one has probability density
$$ \phi(x, y) = \phi(x) \phi(y) = \frac{1}{2\pi}\exp\left(-(x^2 + y^2)/2\right) $$
which can be expressed solely in terms of the distance from the origin, but it\$r = \sqrt{x^2 + y^2}\$:
$$ \phi(r) = \frac{1}{2\pi}\exp\left(-r^2/2\right) $$
This formula applies for any number of dimensions (including \1ドル\$). This means that the distribution is independent of rotation (in any axis) and thus must be evenly distributed along the surface of an n-sphere.
Thanks to Michael Hardy for that explanation .
This is as simple as using instead
Instead, generate the original points with a normal distribution. I'm not sure how to explain the result intuitively, but it is as simple as using instead
Instead, generate the original points with a normal distribution.
This is because the standard normal distribution has a probability density function of
$$ \phi(x) = \frac{1}{\sqrt{2\pi}}\exp\left(-x^2/2\right) $$
so a 2D one has probability density
$$ \phi(x, y) = \phi(x) \phi(y) = \frac{1}{2\pi}\exp\left(-(x^2 + y^2)/2\right) $$
which can be expressed solely in terms of the distance from the origin, \$r = \sqrt{x^2 + y^2}\$:
$$ \phi(r) = \frac{1}{2\pi}\exp\left(-r^2/2\right) $$
This formula applies for any number of dimensions (including \1ドル\$). This means that the distribution is independent of rotation (in any axis) and thus must be evenly distributed along the surface of an n-sphere.
Thanks to Michael Hardy for that explanation .
This is as simple as using instead