\HeaderA{point.in.polygon}{do point(s) fall in a given polygon?}{point.in.polygon}
\keyword{manip}{point.in.polygon}
\begin{Description}\relax
verifies for one or more points whether they fall in a given polygon
\end{Description}
\begin{Usage}
\begin{verbatim}
point.in.polygon(point.x, point.y, pol.x, pol.y)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{point.x}] numerical array of x-coordinates of points
\item[\code{point.y}] numerical array of y-coordinates of points
\item[\code{pol.x}] numerical array of x-coordinates of polygon
\item[\code{pol.y}] numerical array of y-coordinates of polygon
\end{ldescription}
\end{Arguments}
\begin{Value}
integer array; values are:
\begin{ldescription}
\item[\code{0}] 
\item[\code{1}] 
\item[\code{2}] 
\item[\code{3}] 
\end{ldescription}
 point is a vertex of pol.
\end{Value}
\begin{References}\relax
Uses the C function InPoly(), in gstat file polygon.c;
InPoly is Copyright (c) 1998 by Joseph O'Rourke.  It may be freely
redistributed in its entirety provided that this copyright notice is
not removed.
\end{References}
\begin{Examples}
\begin{ExampleCode}
# open polygon:
point.in.polygon(1:10,1:10,c(3,5,5,3),c(3,3,5,5))
# closed polygon:
point.in.polygon(1:10,rep(4,10),c(3,5,5,3,3),c(3,3,5,5,3))
\end{ExampleCode}
\end{Examples}

