sphere: Sampling on the Sphere

View source: R/datasets-generators.R

sphereR Documentation

Sampling on the Sphere

Description

The function sphere() enables uniform sampling of random i.i.d. points on a (d-1)-sphere in R^d. The user should provide the number of points n_samples to be generated on the sphere and the ambient dimension ambient_dim. The radius of the sphere is optional and is equal to 1 by default. Only random points generation is currently available.

Usage

sphere(n_samples, ambient_dim, radius = 1)

Arguments

n_samples

An integer value specifying the sample size.

ambient_dim

An integer value specifying the dimension of the ambient space.

radius

A numeric value specifying the radius of the sphere. Defaults to 1.0.

Value

A numeric array of shape n_\mathrm{samples} \times \mathrm{ambient\_dim} storing n_samples points uniformly sampled on the sphere of dimension ambient_dim - 1.

Examples


sphere(10, 2)


rgudhi documentation built on March 31, 2023, 11:38 p.m.