View source: R/utils-spherical.R
rpsphere | R Documentation |
This function will create a predefined number of points randomly distributed on the surface of a sphere with a given radius.
rpsphere(n = 1, output = "cartesian", radius = authRadius, origin = c(0, 0, 0))
n |
( |
output |
( |
radius |
( |
origin |
( |
The function uses a three dimension normal distribution to generate points, which are then projected to the surface of the sphere.
A 3-column (XYZ) or a 2-column (long-lat) numeric
matrix.
randomPoints <- rpsphere(2000, output="polar")
# observe latitudinal pattern
plot(randomPoints, xlim=c(-180, 180), ylim=c(-90, 90))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.