convex.hull | R Documentation |
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.
ConvexHull
is an experimental C++ implementation of Grahams Scan
without previous triangulation, should be much faster.
convex.hull(tri.obj, plot.it=FALSE, add=FALSE,...)
ConvexHull(x,y)
tri.obj |
object of class |
plot.it |
logical, if |
add |
logical. if |
... |
additional plot arguments |
x |
only for |
y |
only for |
x |
x coordinates of boundary nodes. |
y |
y coordinates of boundary nodes. |
In case that there are several collinear nodes on the convex hull
convex.hull
will return them all while ConvexHull
will only
give edge points.
Albrecht Gebhardt <albrecht.gebhardt@aau.at>, Roger Bivand <roger.bivand@nhh.no>
triSht
, print.triSht
,
plot.triSht
, summary.triSht
, triangles
.
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.