runif_on_sphericalCap: Uniform sampling on a spherical cap

View source: R/sphere.R

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

uniformly documentation built on July 26, 2023, 6:06 p.m.