Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
magicalhippo
on Aug 5, 2018
|
parent
|
context
|
favorite
| on:
Generating random points inside a sphere
It's the fraction of the volume of a cube enclosing (bounding) a sphere to the volume of that sphere.
1 - 4/3*pi*r^3 / (2*r)^3 = ~0.4764
The algorithm samples points inside a unit cube and rejects those not inside the unit sphere, so that's the fraction of points it'll be discarding.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: