swissroll {gasper} | R Documentation |
Swiss Roll Graph Generation
Description
Generates points for a Swiss roll graph. The function maps points from the square into the Swiss roll using the specified transformations.
Usage
swissroll(N = 500, seed = NULL, a = 1, b = 4)
Arguments
N |
Number of points drawn (numeric). |
seed |
Optionally specify a RNG seed for reproducible experiments (numeric). |
a , b |
Shape parameters (numeric). |
Details
Given points within the unit square
, the Swiss roll transformation is achieved using:
and
.
The transformed
coordinates are then projected into 3D space to produce the characteristic rolled shape.
Value
N x 3 array for 3d points.
See Also
Examples
## Not run:
pts <- swissroll(N=500, seed=0, a=1, b=4)
plot3D::scatter3D(pts[,1], pts[,2], pts[,3], colvar=NULL, col="red")
## End(Not run)
[Package gasper version 1.1.6 Index]