View source: R/from_ellipsoid_rellipsoid.R
rellipsoid | R Documentation |
Sample points Roughly Uniformly on the surface of an ellipsoid, 2D or 3D
rellipsoid(n, axes = c(1, 1, 1), center, noise.sd = 0, R = NULL, pieces = 1000)
axes |
vector giving the semi-axis lengths |
center |
center vector, c(x,y) or c(x,y,z) |
noise.sd |
noise sd, 0=no noise |
R |
rotation matrix |
pieces |
Number of pieces to divide the surface into. See details. |
Sampling is done by first sampling uniformly on the surface of a sphere and then transforming with the ellipsoid axes. Corrections:
* 2D: The sampling weights are set to piecewise linear approximation of the ellipse surface integral, the resolution of which is controlled by 'pieces'. * 3D: No weighting at the moment, so very biased for elongated ellipsoids.
Additional nD Gaussian noise can be added by setting 'noise.sd'>0.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.