home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / sci / math / 10605 < prev    next >
Encoding:
Text File  |  1992-08-26  |  1005 b   |  23 lines

  1. Newsgroups: sci.math
  2. Path: sparky!uunet!pipex!warwick!pavo.csi.cam.ac.uk!camcus!gjm11
  3. From: gjm11@cus.cam.ac.uk (G.J. McCaughan)
  4. Subject: Re: Polygon point enclosure
  5. Message-ID: <1992Aug26.235700.16224@infodev.cam.ac.uk>
  6. Sender: news@infodev.cam.ac.uk (USENET news)
  7. Nntp-Posting-Host: bootes.cus.cam.ac.uk
  8. Organization: U of Cambridge, England
  9. References:  <7122@bigbird.hri.com.hri.com>
  10. Date: Wed, 26 Aug 1992 23:57:00 GMT
  11. Lines: 10
  12.  
  13. In article <7122@bigbird.hri.com.hri.com>, mps@sparc68.hri.com (Mark Stockley) writes:
  14.  
  15. > I'm looking for a method to determine if a point is enclosed
  16. > by a polygon. Any help would be greatly appreciated.
  17.  
  18. Well, here's one approach. Imagine a ray (=half-line) coming off from the point
  19. in some direction. Count how many of the sides of the polygon it goes through.
  20. (If it goes *along* any of those sides you're in trouble and should try another
  21. direction.) If it's an odd number the point is inside the polygon; if it's an
  22. even number the point is outside the polygon.
  23.