Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

convex.hull

Return the convex hull of a triangulation object


Description

Given a triangulation tri.obj of n points in the plane, this subroutine returns two vectors containing the coordinates of the nodes on the boundary of the convex hull.

Usage

convex.hull(tri.obj, plot.it=FALSE, add=FALSE,...)

Arguments

tri.obj

object of class "tri"

plot.it

logical, if TRUE the convex hull of tri.obj will be plotted.

add

logical. if TRUE (and plot.it=TRUE), add to a current plot.

...

additional plot arguments

Value

x

x coordinates of boundary nodes.

y

y coordinates of boundary nodes.

Author(s)

A. Gebhardt

References

R. J. Renka (1996). Algorithm 751: TRIPACK: a constrained two-dimensional Delaunay triangulation package. ACM Transactions on Mathematical Software. 22, 1-8.

See Also

Examples

# rather simple example from TRIPACK:
data(tritest)
tr<-tri.mesh(tritest$x,tritest$y)
convex.hull(tr,plot.it=TRUE)
# random points:
rand.tr<-tri.mesh(runif(10),runif(10))
plot(rand.tr)
rand.ch<-convex.hull(rand.tr, plot.it=TRUE, add=TRUE, col="red")
# use a part of the quakes data set:
data(quakes)
quakes.part<-quakes[(quakes[,1]<=-17 & quakes[,1]>=-19.0 &
                     quakes[,2]<=182.0 & quakes[,2]>=180.0),]
quakes.tri<-tri.mesh(quakes.part$lon, quakes.part$lat, duplicate="remove")
plot(quakes.tri)
convex.hull(quakes.tri, plot.it=TRUE, add=TRUE, col="red")

tripack

Triangulation of Irregularly Spaced Data

v1.3-9.1
ACM | file LICENSE
Authors
Fortran code by R. J. Renka. R functions by Albrecht Gebhardt <albrecht.gebhardt@aau.at>. With contributions from Stephen Eglen <stephen@anc.ed.ac.uk>, Sergei Zuyev <sergei@stams.strath.ac.uk> and Denis White <white.denis@epamail.epa.gov>
Initial release
2020-03-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.