runif_cube | R Documentation |
Uniform sampling on or in a cube (arbitrary dimension).
runif_in_cube(n, d, O = rep(0, d), r = 1)
runif_on_cube(n, d, O = rep(0, d), r = 1)
n |
number of simulations |
d |
dimension |
O |
center of the cube |
r |
radius (half-side) of the cube |
The simulations in a n
times d
matrix.
sims <- runif_on_cube(60, d = 2)
plot(sims, xlim = c(-1,1), ylim = c(-1,1), pch = 19, asp = 1)
sims <- runif_in_cube(50, d = 3)
library(scatterplot3d)
scatterplot3d(sims, pch = 19, highlight.3d = TRUE, asp = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.