torusUnif | R Documentation |
The function torusUnif
samples n
points from the 3D torus, uniformly with respect to its surface.
torusUnif(n, a, c)
n |
an integer specifying the number of points in the sample. |
a |
the radius of the torus tube. |
c |
the radius from the center of the hole to the center of the torus tube. |
This function torusUnif
is an implementation of Algorithm 1 in the reference.
The function torusUnif
returns an n
by 3 matrix of coordinates.
Fabrizio Lecci
Diaconis P, Holmes S, and Shahshahani M (2013). "Sampling from a manifold." Advances in Modern Statistical Theory and Applications: A Festschrift in honor of Morris L. Eaton. Institute of Mathematical Statistics, 102-125.
circleUnif
,sphereUnif
X <- torusUnif(300, a = 1.8, c = 5)
plot(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.