runif_on_stri | R Documentation |
Uniform sampling on a spherical triangle (in dimension 3).
runif_on_stri(n, r = 1, v1, v2, v3)
n |
number of simulations |
r |
radius |
v1, v2, v3 |
vertices |
The simulations in a n
times 3
matrix.
# sampling on the first orthant:
sims <- runif_on_stri(100, v1 = c(1, 0, 0), v2 = c(0, 1, 0), v3 = c(0, 0, 1))
## Not run:
library(rgl)
spheres3d(0, 0, 0, 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.