Skip to contents

convexHull computes the subset of points which lie on the convex hull of the set of points specified.

Usage

convexHull(x, y, clockwise = TRUE)

Arguments

x

A vector of x coordinates.

y

A vector of y coordinates of the same lenght as x.

clockwise

If TRUE (the default), the output convex hull is oriented clockwise. Otherwise, it is oriented counter-clockwise.

Value

A vector indicating the index of the points on the convex hull.

Author

Simon Garnier, garnier@njit.edu

Examples

convexHull(rnorm(100), rnorm(100))
#> [1] 46 63 47 15 13  6  8 35 38