[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: point projection on polyline

From: Juan Pablo Carbajal
Subject: Re: point projection on polyline
Date: Thu, 4 Feb 2016 14:07:53 +0100

On Wed, Feb 3, 2016 at 2:43 PM, Juan Pablo Carbajal <address@hidden> wrote:

On Wed, Feb 3, 2016 at 12:25 PM, rcharan51 <address@hidden> wrote:
I have finally succeeded to hash out the unwanted area in the graph and
decreased the elapsed time. Thank you for the idea.

Also I modified the existing distancePointPolyline function to calculate
both orthogonal distance and projection without for loops !!  (code: I have tested it, and it only works
for open polylines. For closed polylines it is not giving correct
projections. I am not able to figure where the problem is. Please go through
the code given above and let me know of my mistakes.

View this message in context:
Sent from the Octave - General mailing list archive at

Help-octave mailing list

Thanks a lot!

I am happy to hear you succeeded. If you think you can provide a 2D hashing function, we could add it to geometry.
I will check the code and update the package. I will add your copyright to the function.

Hi, I just reviewed your code.
1. You do not need ot use ".-" or ".+" subtraction and addition are always element-wise.
2. You can do inf (n,m) instead of inf*ones(n,m). I know David had it like that, but when I see this I correct it.
3. Do not use varargin or varargout unless you need them. David also the habit of using them by default, but I correct it when I see it.
4. For closed polys you need to add a point at the end. Check how projPointOnPolyline.m does it.

I am now profiling your code to see if there is an advantage.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]