From: c. <kin...@ti...> - 2012-09-10 11:05:58
|
On 10 Sep 2012, at 13:01, c. wrote: > Hi, > > I need to compute the "signed distance" of a point P from a polygon Q, > i.e., the distance of P from the polyline including Q with a "+" sign if > the point is inside the polygon and a "-" sign if it is outside. > > I see "distancePointPolygon" in the geometry package computes the distance > but always returns a positive number. Is there already a function to do > what I need? > > If not, any idea where I can look-up the algorithm to modify "distancePointPolygon" > according to my needs? > > Thanks, > c. To answer my own question, I just found the built-in function "inpolygon" that checks whether a point is inside or outside a polygon. Sorry for the noise. c. |