runif_on_sphericalCap | R Documentation |
Uniform sampling on a spherical cap (in dimension 3).
runif_on_sphericalCap(n, r = 1, h)
n |
number of simulations |
r |
radius of the sphere |
h |
height of the cap |
The simulations in a n
times 3
matrix.
sims <- runif_on_sphericalCap(500, r = 2, h = 1)
## Not run:
library(rgl)
spheres3d(0, 0, 0, radius = 2, color = "red", alpha = 0.5)
points3d(sims)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.