Sphere function with random noise
This function calculates the Euclidian distance from a point to the origin after a random displacement of its position.
sphereN(x, sd = 0.1, aggregate = TRUE)
x
: The coordinates of the pointsd
: The standard deviation of the noise to be added to the position of x
, a normal distribution with mean zero is used.aggregate
: If aggregate
is TRUE
the distance is returned, otherwise the size of the projection of the distance among each axis.The distance from the point x
to the origin after a random displacement.
sphereN(rep(0, 10))
Ricardo Oliveros--Ramos
Useful links