sphereUnif: Uniform Sample From The Sphere S^d

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/sphereUnif.R

Description

The function sphereUnif samples n points from the sphere S^d of radius r embedded in R^{d+1}, uniformly with respect to the volume measure of the sphere.

Usage

1
sphereUnif(n, d, r = 1)

Arguments

n

an integer specifying the number of points in the sample.

d

an integer specifying the dimension of the sphere S^d

r

a numeric variable specifying the radius of the sphere. The default value is 1.

Value

The function sphereUnif returns an n by 2 matrix of coordinates.

Note

When d = 1, this function is same as using circleUnif.

Author(s)

Jisu Kim

See Also

circleUnif, torusUnif

Examples

1
2
X <- sphereUnif(n = 100, d = 1, r = 1)
plot(X)

TDA documentation built on March 30, 2021, 5:10 p.m.