plotConvexHull: Computes and displays the convex hull of a set of 2-dimensional points
Description
Given a vector of 2-dimensional coordinates, computes and displays the convex hull formed by these points.
Usage
plotConvexHull(xin, LB, UB, xlab, ylab)
Arguments
xin
n x 2 vector of coordinate points
LB
2x1 vector of lower bounds for the x,y region where the convex hull is to be plot. Required.
UB
2x1 vector of lower bounds for the x,y region where the convex hull is to be plot. Required.
xlab
Label for x axis.
ylab
Label for y axis.
Value
An integer vector giving the indices of the unique points lying on the convex hull, in clockwise order. (The first will be returned for duplicate points.). Same as returned by chull(xin).
## Generate some random 2-dimensional point setX<-cbind(runif(100,-2,2),runif(100,-2,2))
## Compute and plot convex hullplotConvexHull(xin=X, LB=c(-4,-4), UB=c(4,4), xlab='X', ylab='Y')