powered by
Returns points uniformly sampled from square or rectangle in plane.
runif_square(n, xmin = 0, xmax = 1, ymin = 0, ymax = 1)
n by 2 matrix of points
number of points
minimum x coordinate
maximum x coordinate
minimum y coordinate
maximum y coordinate
# Sample 100 points from unit square runif_square(100) # Sample 100 points from unit square centered at origin runif_square(100, 0.5, 0.5, 0.5, 0.5)
Run the code above in your browser using DataLab