-
-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnitCircle including the inside #797
Comments
Actually, we already discussed the names: 'circle' typically refers to just the edge, while 'disc' refers to the internal area. For a sphere, the edge might be called a 'shell', but that name appeared more confusing, hence the desicision to use
See the discussion in #567. Implementing these should be straightforward, and I don't see why they shouldn't be added (to |
Hm, 'sphere' also usually refers to the shell, and the interior is called 'ball', I think? |
Sampling from inside a circle or sphere is most efficiently done using rejection sampling, so it is very easy to implement (see the corresponding benchmarks). I'm fine with adding them to |
Those appear to be the terms used by Wikipedia and Wolfram at least; I'm happy to switch to this terminology. @vks? This is actually a good time to rename Another thing occuring to me is that we could abstract over dimensions as follows, though probably this is more confusing than useful: impl Distribution<[f64; 2]> for UnitSphere { .. }
impl Distribution<[f64; 3]> for UnitSphere { .. } |
I would like to produce random points inside a circle.
A
UnitCircleInside
andUnitSphereInside
distributions would be great to have.Also, there is currently
UnitCircle
distribution, but it only produces points on edge. And this is not obvious since there is alsoUnitSphereSurface
which states such fact in the name. So, ideallyUnitCircle
could be renamed toUnitCircleEdge
.The text was updated successfully, but these errors were encountered: