chullsphere: Spherical convex hull.

View source: R/utils-spherical.R

chullsphereR Documentation

Spherical convex hull.

Description

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.

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.

Value

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

Examples

# generate some random points
allData <- rpsphere(1000)
# select only a subset
points<-allData[allData[,1]>3000,]
chullsphere(points)



adamkocsis/icosa documentation built on Aug. 20, 2024, 1:35 a.m.