Re: Point inside a plygon?
- To: mathgroup at smc.vnet.net
- Subject: [mg25382] Re: [mg25239] Point inside a plygon?
- From: "Christopher J. Henrich" <chenrich at monmouth.com>
- Date: Fri, 29 Sep 2000 01:06:14 -0400 (EDT)
- References: <8qhmln$ivh@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
David Park wrote: > > Adriano, > > Here is a different solution for the point inside a polygon question. > > PointInPolygon::usage = > "PointInPolygon[point, polygonvertices] will determine if a point is \ > within a polygon defined by its vertices. Its method is to calculate the \ > cross product of each leg of the polygon with the vector from the base of > the \ > leg to the point. If there is a change in sign of the z component going \ > around the polygon, the point is outside the polygon."; > > > -----Original Message----- > > > > I need a routine to check if a point is inside or outside a polygon > > (simple polygon non self-intersecting). > > Any help appreciated. > > > > Adriano Moreira > > David Park's solution is correct if the polynomial in question is convex. If it is not, then the problem is more difficult. Chris Henrich