Learn R Programming

ashapesampler (version 1.0.0)

runif_ball_3D: Uniform Ball 3D

Description

Returns points uniformly centered from closed ball of radius r in 3D space

Usage

runif_ball_3D(n, r = 1)

Value

n by 3 matrix of points

Arguments

n

number of points

r

radius of ball, default r=1

Examples

Run this code
# Sample 100 points from unit ball
runif_ball_3D(100)
# Sample 100 points from ball of radius 0.5
runif_ball_3D(100, r=0.5)

Run the code above in your browser using DataLab