runif_on_sphericalCap {uniformly}R Documentation

Uniform sampling on a spherical cap

Description

Uniform sampling on a spherical cap (in dimension 3).

Usage

runif_on_sphericalCap(n, r = 1, h)

Arguments

n

number of simulations

r

radius of the sphere

h

height of the cap

Value

The simulations in a n times 3 matrix.

Examples

sims <- runif_on_sphericalCap(500, r = 2, h = 1)
## Not run: 
library(rgl)
spheres3d(0, 0, 0, radius = 2, color = "red", alpha = 0.5)
points3d(sims)
## End(Not run)

[Package uniformly version 0.5.0 Index]