chull                  package:base                  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
          components `x' and `y'

_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.

_A_u_t_h_o_r(_s):

     B. D. Ripley

_R_e_f_e_r_e_n_c_e_s:

     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:

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

