Learn R Programming

TDA (version 1.3)

sphereUnif: Uniform Sample From The Sphere $S^d$

Description

This function 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

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. Default is 1.

Value

  • sphereUnif returns an n by 2 matrix of coordinates.

See Also

circleUnif, torusUnif

Examples

Run this code
X=sphereUnif(100,1)
plot(X)

Run the code above in your browser using DataLab