Learn R Programming

ashapesampler (version 1.0.0)

runif_cube: r Uniform Cube

Description

Returns points uniformly sampled from cube or rectangular prism in space.

Usage

runif_cube(n, xmin = 0, xmax = 1, ymin = 0, ymax = 1, zmin = 0, zmax = 1)

Value

n by 3 matrix of points

Arguments

n

number of points to be sampled

xmin

miniumum x coordinate

xmax

maximum x coordinate

ymin

minimum y coordinate

ymax

maximum y coordinate

zmin

minimum z coordinate

zmax

maximum z coordinate

Examples

Run this code
# 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