Surface centroid point of a spherical point cloud
This function the projected place of the centroid from a pointset on the sphere.
surfacecentroid(x, ...) ## S4 method for signature 'matrix' surfacecentroid(x, output = "polar", center = c(0, 0, 0), radius = authRadius) ## S4 method for signature 'data.frame' surfacecentroid(x, ...) ## S4 method for signature 'SpatialPoints' surfacecentroid(x, ...)
x |
( |
... |
Arguments passed to the |
output |
( |
center |
( |
radius |
( |
The function implements great circle calculations to infer on the place of the centroid, which makes it resource demanding. This is necessary to avoid a particual error that frequently occurrs with other methods for centroid calculation, namely that the place of the centroid is right, but on the opposite hemisphere.
Either an XYZ or a long-lat numeric
vector.
# generate some random points allData <- rpsphere(1000) # select only a subset points<-allData[allData[,2]>1500,] # transform to 2d points2 <- CarToPol(points, norad=TRUE) # the spherical centroid sc <- surfacecentroid(points2, output="polar") sc #3d plot plot(points2, xlim=c(-180, 180), ylim=c(-90, 90)) points(sc[1], sc[2], col="red", cex=5)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.