powered by
Returns points uniformly sampled from cube or rectangular prism in space.
runif_cube(n, xmin = 0, xmax = 1, ymin = 0, ymax = 1, zmin = 0, zmax = 1)
n by 3 matrix of points
number of points to be sampled
miniumum x coordinate
maximum x coordinate
minimum y coordinate
maximum y coordinate
minimum z coordinate
maximum z coordinate
# Sample 100 points from unit cube runif_cube(100) # Sample 100 points from unit cube centered on origin runif_cube(100, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5)
Run the code above in your browser using DataLab