On Mon, Sep 10, 2012 at 1:01 PM, c. <carlo.defa...@gmail.com> 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.

Hi,

I would not modify the function, but use it together with inpolygon
(in the core geomtry package).

I guess this is what you want
http://agora.octave.org/snippet/FRXH/

Let me know



-- 
JuanPi Carbajal
-----
"The bad economist pursues a small present good, which will be
followed by a great evil to come, while the true economist pursues a
great good to come, at the risk of a small present evil." - Frédéric
Bastiat
-----
http://ailab.ifi.uzh.ch/carbajal/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to