home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math
- Path: sparky!uunet!caen!umeecs!umn.edu!thompson
- From: thompson@atlas.socsci.umn.edu (T. Scott Thompson)
- Subject: Re: Polygon point enclosure
- Message-ID: <thompson.714948491@daphne.socsci.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: daphne.socsci.umn.edu
- Reply-To: thompson@atlas.socsci.umn.edu
- Organization: Economics Department, University of Minnesota
- References: <7122@bigbird.hri.com.hri.com> <1992Aug26.235700.16224@infodev.cam.ac.uk> <thompson.714934114@daphne.socsci.umn.edu> <1992Aug27.180024.2843@linus.mitre.org>
- Date: Thu, 27 Aug 1992 20:48:11 GMT
- Lines: 29
-
- bs@gauss.mitre.org (Robert D. Silverman) writes:
-
- >:>> I'm looking for a method to determine if a point is enclosed
- >:>> by a polygon. Any help would be greatly appreciated.
-
- [algorithm deleted]
-
- >:This algorithm is in _Algorithms_ by Robert Sedgewick, Addison-Wesley
-
- >I will assume that the polygon is given by a set of points.
-
- >Counting how many sides it intersects seems to require computing the
- >equation for the line containing each side and determining whether
- >the ray intersects the line between the two points. This requires
- >computing O(N) equations and intersections.
-
- >Why is this any faster than simply representing the interior of
- >the polygon as a set of linear inequalities and simply checking
- >whether the desired point satisfies each inequality?? This is also O(N).
- >This is essentially equivalent to whether a solution is feasible
- >in linear programming.
-
- This approach only works if the polygon is convex. Sedgewick's
- algorithm works on nonconvex polygons too.
-
- --
- T. Scott Thompson email: thompson@atlas.socsci.umn.edu
- Department of Economics phone: (612) 625-0119
- University of Minnesota fax: (612) 624-0209
-