runif_square: Uniform Sampling from Square

View source: R/2D.R

runif_squareR 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)

ashapesampler documentation built on May 29, 2024, 3:22 a.m.