

   chull {base}                                 R Documentation

   CCoommppuuttee CCoonnvveexx HHuullll ooff aa SSeett ooff PPooiinnttss

   DDeessccrriippttiioonn::

        Computes the subset of points which lie on the convex
        hull of the set of points specified.

   UUssaaggee::

        chull(x, y=NULL)

   AArrgguummeennttss::

       x, y: coordinate vectors of points. This can be speci-
             fied as two vectors `x' and `y', a 2-column matrix
             `x', a list `x' with components `x' and `y'

   DDeettaaiillss::

        `xy.coords' is used to interpret the specification of
        the points. The algorithm is that given by Eddy (1977).

        `Peeling' as used in the S function `chull' can be
        implemented by calling `chull' recursively.

   VVaalluuee::

        An integer vector giving the indices of the points
        lying on the convex hull, in clockwise order.

   AAuutthhoorr((ss))::

        B. D. Ripley

   RReeffeerreenncceess::

        Eddy, W. F. (1977) A new convex hull algorithm for pla-
        nar sets.  ACM Transactions on Mathematical Software,
        3, 398-403.

        Eddy, W. F. (1977) Algorithm 523. CONVEX, A new convex
        hull algorithm for planar sets[Z]. ACM Transactions on
        Mathematical Software, 3, 411-412.

   SSeeee AAllssoo::

        `xy.coords',`polygon'

   EExxaammpplleess::

        X <- matrix(rnorm(2000), ncol=2)
        plot(X, cex=0.5)
        hpts <- chull(X)
        hpts <- c(hpts, hpts[1])
        lines(X[hpts, ])

