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

  1. Newsgroups: comp.programming
  2. Path: sparky!uunet!s5!is1.is.morgan.com!is.morgan.com!berlin
  3. From: berlin@is.morgan.com (Alexander Berlin)
  4. Subject: Re: Deciding point-in-polygon: A new idea.
  5. Message-ID: <1992Aug31.092205@is.morgan.com>
  6. Sender: news@is.morgan.com
  7. Nntp-Posting-Host: chico
  8. Organization: Morgan Stanley - IS
  9. References:  <schnitzi.715219193@eola.cs.ucf.edu>
  10. Distribution: comp
  11. Date: Mon, 31 Aug 1992 13:22:05 GMT
  12. Lines: 39
  13.  
  14. In article <schnitzi.715219193@eola.cs.ucf.edu>, schnitzi@cs.ucf.edu (Mark Schnitzius) writes:
  15. |> How about this:
  16. |> 
  17. |> Compute the area of the polygon in question (this is a well
  18. |> known and simple procedure).  Now consider the polygon formed
  19. |> by adding the point in question as another vertice, anywhere
  20. |> in the original list of vertices.  If the area of this new
  21. |> polygon is greater than the original, the point is outside
  22. |> the polygon.  If less, it is inside.
  23. |> 
  24. |> My question:  will it work?
  25. |> 
  26.  
  27.   No, it won't.
  28.  
  29.     A                  B
  30.      +----------------+         See what happens when you go from ABCD to
  31.      |                |         ABXCD. 
  32.      |                |
  33.   X  |                |
  34.   .  |                |
  35.      |                |
  36.      |                |
  37.      |                |
  38.      |                |
  39.      |                |
  40.      +----------------+    
  41.      D                C
  42.  
  43.  
  44.  
  45. |> 
  46. |> Mark Schnitzius
  47. |> schnitzi@eola.csu.ucf.edu
  48. |> Univ. of Central Florida
  49.  
  50. ---
  51. Alex Berlin                     
  52. berlin@is.morgan.com
  53.