torus: Sampling on the Torus

View source: R/datasets-generators.R

torusR Documentation

Sampling on the Torus

Description

The user should provide the number of points n_samples to be generated on the torus and the dimension dim of the torus on which points would be generated in R^{2 \mathrm{dim}}. The sample argument is optional and is set to "random" by default. The generated points are returned as an array of shape n_\mathrm{samples} \times R^{2 \mathrm{dim}}.

Usage

torus(n_samples, dim, sample = c("random", "grid"))

Arguments

n_samples

An integer value specifying the sample size.

dim

An integer value specifying the dimension R^{2 \mathrm{dim}} of the torus.

sample

A string specifying the sampling type. Choices are "random" or "grid". Defaults to "random".

Value

A numeric array of shape n_\mathrm{samples} \times R^{2 \mathrm{dim}} storing the sampled points.

Examples


torus(10, 1)


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