home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / programm / 2523 < prev    next >
Encoding:
Text File  |  1992-08-29  |  1.1 KB  |  31 lines

  1. Path: sparky!uunet!pmafire!news.dell.com!swrinde!zaphod.mps.ohio-state.edu!usc!rutgers!psinntp!psinntp!svc!news
  2. From: moose@svcdudes.com
  3. Newsgroups: comp.programming
  4. Subject: Re: How to decide if a point is inside a polygon?
  5. Message-ID: <1992Aug27.162441.18118@svcdudes.com>
  6. Date: 27 Aug 92 16:24:41 GMT
  7. References: <7121@bigbird.hri.com.hri.com>
  8. Sender: news@svcdudes.com
  9. Reply-To: moose@svcdudes.com
  10. Distribution: na
  11. Organization: Software Ventures, Inc.
  12. Lines: 17
  13.  
  14. In article <7121@bigbird.hri.com.hri.com> mps@sparc68.hri.com (Mark Stockley)  
  15. writes:
  16. > I am in need of an algorithm to compute whether or not a given
  17. > point exists within or without a polygon. Any help or pointers to
  18. > where to look would be much appreciated.
  19.  
  20. Draw a line from the point to anywhere definately outside the polygon.  Count  
  21. the number of times the line crosses the polygon border.  If it's odd, the  
  22. original point is inside the polygon, if it's even, it was outside.
  23.  
  24.  
  25. --
  26. Michael Rutman            |    moose@svcdudes.com
  27. Cubist                |    makes me a NeXT programmer
  28. Software Ventures        |    maker of MicroPhone Pro
  29. #include <std.disclaimer>    |    really offesive political statement
  30.