The R Project SVN R

Rev

Rev 61168 | Rev 68948 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 61168 Rev 62213
Line 1... Line 1...
1
% File src/library/grDevices/man/chull.Rd
1
% File src/library/grDevices/man/chull.Rd
2
% Part of the R package, http://www.R-project.org
2
% Part of the R package, http://www.R-project.org
3
% Copyright 1995-2007 R Core Team
3
% Copyright 1995-2013 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{chull}
6
\name{chull}
7
\alias{chull}
7
\alias{chull}
8
\title{Compute Convex Hull of a Set of Points}
8
\title{Compute Convex Hull of a Set of Points}
Line 19... Line 19...
19
  set of points specified.
19
  set of points specified.
20
}
20
}
21
\details{
21
\details{
22
  \code{\link{xy.coords}} is used to interpret the
22
  \code{\link{xy.coords}} is used to interpret the
23
  specification of the points. The algorithm is that given by Eddy (1977).
23
  specification of the points. The algorithm is that given by Eddy (1977).
24
 
-
 
25
  \sQuote{Peeling} as used in the S function \code{chull} can be
-
 
26
  implemented by calling \code{chull} recursively.
-
 
27
}
24
}
28
\value{
25
\value{
29
  An integer vector giving the indices of the points lying on the
26
  An integer vector giving the indices of the unique points lying on the
30
  convex hull, in clockwise order.
27
  convex hull, in clockwise order.  (The first will be returned for
-
 
28
  duplicate points.)
31
}
29
}
32
\references{
30
\references{
33
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
31
  Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)
34
  \emph{The New S Language}.
32
  \emph{The New S Language}.
35
  Wadsworth & Brooks/Cole.
33
  Wadsworth & Brooks/Cole.
Line 42... Line 40...
42
    Mathematical Software}, \bold{3}, 411--412.
40
    Mathematical Software}, \bold{3}, 411--412.
43
}
41
}
44
\seealso{\code{\link{xy.coords}}, \code{\link{polygon}}}
42
\seealso{\code{\link{xy.coords}}, \code{\link{polygon}}}
45
 
43
 
46
\examples{
44
\examples{
47
require(stats)
-
 
48
X <- matrix(rnorm(2000), ncol = 2)
45
X <- matrix(stats::rnorm(2000), ncol = 2)
49
chull(X)
46
chull(X)
50
\dontrun{
47
\dontrun{
51
  # Example usage from graphics package
48
  # Example usage from graphics package
52
  plot(X, cex = 0.5)
49
  plot(X, cex = 0.5)
53
  hpts <- chull(X)
50
  hpts <- chull(X)