Skip to contents

This function calculates a possible implementation of the spherical convex hull.

Usage

chullsphere(
  data,
  center = c(0, 0, 0),
  radius = authRadius,
  param = 200,
  strict = TRUE
)

Arguments

data

(numeric) Matrix, XYZ or longitude-latitude coordinates of the set of points.

center

(numeric) Vector, The center of the sphere in XYZ coordinates (default is 0,0,0).

radius

(numeric) Single value, indicating the radius of the sphere. Defaults to the R2 radius of Earth (6371.007km).

param

(numeric) Single positive integer, indicates the number of divisions in the centroid projection method. The higher the number, the closer the replacement points are to the centroid.

strict

(logical) Strictly convex output is required.

Value

The indices of the data points forming the convex hull as a (numeric) vector.

Details

With the method centroidprojection the function calls the surfacecentroid function to get the a reference point from the shape. Then all the points are 'projected' close to this point using the great circles linking them to the reference point. Each such great circle will be devided to an equal number of points and the closest will replace the original point coordinates in the convex hull algorithm implemented in chull.

Examples

# generate some random points
allData <- rpsphere(1000)
# select only a subset
points<-allData[allData[,1]>3000,]
chullsphere(points)
#>  [1]  32 179 103   7  26 155  62 255  73 126 228  80 142 100