home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.graphics
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!nntp.msstate.edu!willis1.cis.uab.edu!sloan
- From: sloan@cis.uab.edu (Kenneth Sloan)
- Subject: Re: Polygon (or point) within an arbitrary polygon
- Message-ID: <1992Nov19.162151.12862@cis.uab.edu>
- Organization: CIS, University of Alabama at Birmingham
- References: <HINKER.92Nov19081251@cocker.acl.lanl.gov>
- Date: Thu, 19 Nov 1992 16:21:51 GMT
- Lines: 36
-
- In article <HINKER.92Nov19081251@cocker.acl.lanl.gov> Paul J. Hinker <hinker@acl.lanl.gov> writes:
- >...
- >
- > I would like to take the point in a triangle question a step
- >further and ask if there is an efficient way to decide whether or not
- >a polygon (or point for that matter) is contained by another polygon.
- >
-
- Point-in-polygon has been thrashed out here - Eric Haines has the
- history. Beware of solutions whose idea of "inside" differs from yours.
-
- Polygon-in-polygon seems to me to be a very hard problem. Let's see: if
- al you want is a YES/NO answer to the question 'does polygon P lie
- entirely inside polygon Q', then:
-
- *all vertices of P must lie inside Q (see Eric)
- *all segments of the perimeter of P must lie inside Q
-
- The first condition is necessary, but not sufficient. The second
- condition is both necessary and sufficient (but probably has
- sub-problems just like the first condition).
-
- I would expect a practical solution to this problem to consist of
- several "quick-kill" tests (all giving the answer "NO") followed by one
- very expensive test to make sure the answer is "YES". I can't
- immediately see any alternative to intersecting every segment of P's
- perimeter with every segment of Q's perimeter (plus one Point-in-Polygon
- test to distinguish between totally-in and totally-out.
-
- You could always announce a contest...
-
- --
- Kenneth Sloan Computer and Information Sciences
- sloan@cis.uab.edu University of Alabama at Birmingham
- (205) 934-2213 115A Campbell Hall, UAB Station
- (205) 934-5473 FAX Birmingham, AL 35294-1170
-