chull               package:grDevices               R Documentation

_C_o_m_p_u_t_e _C_o_n_v_e_x _H_u_l_l _o_f _a _S_e_t _o_f _P_o_i_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     chull(x, y = NULL)

_A_r_g_u_m_e_n_t_s:

    x, y: coordinate vectors of points. This can be specified as two
          vectors 'x' and 'y', a 2-column matrix 'x', a list 'x' with
          two components, etc, see 'xy.coords'.

_D_e_t_a_i_l_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_a_l_u_e:

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

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

     Eddy, W. F. (1977) A new convex hull algorithm for planar 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_e_e _A_l_s_o:

     'xy.coords','polygon'

_E_x_a_m_p_l_e_s:

     require(stats)
     X <- matrix(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)

