runif_square {ashapesampler} | R Documentation |
Uniform Sampling from Square
Description
Returns points uniformly sampled from square or rectangle in plane.
Usage
runif_square(n, xmin = 0, xmax = 1, ymin = 0, ymax = 1)
Arguments
n |
number of points |
xmin |
minimum x coordinate |
xmax |
maximum x coordinate |
ymin |
minimum y coordinate |
ymax |
maximum y coordinate |
Value
n by 2 matrix of points
Examples
# 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)
[Package ashapesampler version 1.0.0 Index]