plotConvexHull: Computes and displays the convex hull of a set of...

Description Usage Arguments Value Note Author(s) Examples

View source: R/OptRegionTps.R View source: R/OptRegionQuad.R

Description

Given a vector of 2-dimensional coordinates, computes and displays the convex hull formed by these points.

Usage

1
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).

Note

Function also plots the convex hull upon return.

Author(s)

E. del Castillo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
## Generate some random 2-dimensional point set

X<-cbind(runif(100,-2,2),runif(100,-2,2))

## Compute and plot convex hull

plotConvexHull(xin=X, LB=c(-4,-4), UB=c(4,4), xlab='X', ylab='Y')

## End(Not run)

OptimaRegion documentation built on May 29, 2017, 12:44 p.m.