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

convex_hull

Convex hull of a set of vertices


Description

Calculate the convex hull of a set of points, i.e. the covering polygon that has the smallest area.

Usage

convex_hull(data)

Arguments

data

The data points, a numeric matrix with two columns.

Value

A named list with components:

resverts

The indices of the input vertices that constritute the convex hull.

rescoords

The coordinates of the corners of the convex hull.

Author(s)

Tamas Nepusz ntamas@gmail.com

References

Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0262032937. Pages 949-955 of section 33.3: Finding the convex hull.

Examples

M <- cbind( runif(100), runif(100) )
convex_hull(M)

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

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