EVOLUTION-MANAGER
Edit File: chull.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Compute Convex Hull of a Set of Points</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for chull {grDevices}"><tr><td>chull {grDevices}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Compute Convex Hull of a Set of Points</h2> <h3>Description</h3> <p>Computes the subset of points which lie on the convex hull of the set of points specified. </p> <h3>Usage</h3> <pre> chull(x, y = NULL) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x, y</code></td> <td> <p>coordinate vectors of points. This can be specified as two vectors <code>x</code> and <code>y</code>, a 2-column matrix <code>x</code>, a list <code>x</code> with two components, etc, see <code><a href="xy.coords.html">xy.coords</a></code>.</p> </td></tr> </table> <h3>Details</h3> <p><code><a href="xy.coords.html">xy.coords</a></code> is used to interpret the specification of the points. Infinite, missing and <code>NaN</code> values are not allowed. </p> <p>The algorithm is that given by Eddy (1977). </p> <h3>Value</h3> <p>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.) </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988). <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <p>Eddy, W. F. (1977). A new convex hull algorithm for planar sets. <em>ACM Transactions on Mathematical Software</em>, <b>3</b>, 398–403. doi: <a href="https://doi.org/10.1145/355759.355766">10.1145/355759.355766</a>. </p> <p>Eddy, W. F. (1977). Algorithm 523: CONVEX, A new convex hull algorithm for planar sets [Z]. <em>ACM Transactions on Mathematical Software</em>, <b>3</b>, 411–412. doi: <a href="https://doi.org/10.1145/355759.355768">10.1145/355759.355768</a>. </p> <h3>See Also</h3> <p><code><a href="xy.coords.html">xy.coords</a></code>, <code><a href="../../graphics/html/polygon.html">polygon</a></code> </p> <h3>Examples</h3> <pre> X <- matrix(stats::rnorm(2000), ncol = 2) chull(X) ## Not run: # Example usage from graphics package plot(X, cex = 0.5) hpts <- chull(X) hpts <- c(hpts, hpts[1]) lines(X[hpts, ]) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>grDevices</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>