[S] Points in or out of polygon

Gebhart, Kristi (Gebhart@CIRA.colostate.edu)
Wed, 4 Mar 1998 09:52:45 -0700


Hi S-PLUSers,
I have a need to determine whether or not points are in or out of
arbitrarily shaped and located polygons. Has anyone written an S-PLUS
function that would do something like, given the x-y coordinates of the
vertices of a polygon, determine whether the x-y coordinates of another
point are inside or outside of it?

Many years ago I wrote one in FORTRAN, but I'm clueless as to how to
link FORTRAN to S-PLUS and don't have the Watcom compiler. This is a
task that I know gets used in graphics applications (i.e. to determine
which pixels get painted in a fill). Is there any chance that there's a
graphics library function that already does something like this? If not
I guess I'll get busy and translate my old subroutine.

Thanks, KG
----------------------------------------------------------
Kristi A. Gebhart
Research Physical Scientist
National Park Service, Air Resources Division
CIRA, Colorado State University
Fort Collins, CO 80523
(970) 491-3684 (voice)
(970) 491-8598 (fax)
gebhart@cira.colostate.edu

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news