help-octave
[Top][All Lists]
Advanced

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

Re: Geometry pointOnLine Fails


From: Juan Pablo Carbajal
Subject: Re: Geometry pointOnLine Fails
Date: Wed, 4 May 2016 00:36:37 +0200

On Wed, May 4, 2016 at 12:12 AM, Thomas D. Dean <address@hidden> wrote:
> I have a failure with pointOnLine, using the line and point option.
>
> The document allows the arguments to be a line and a point or a line and a
> distance.
>
> The function definition only seems to handle the line and distance option.
>
> I think the definition should be something like
>
> function point = pointOnLine(lin, pos)
>   ang = lineAngle(lin);
>   if  size(pos) == [1,2]
>     point = [lin(:,1)+pos(1,1).*cos(ang), lin(:,2)+pos(1,2).*sin(ang)];
>   elseif size(pos) == [1,1]
>     point = [lin(:,1) + pos .* cos(ang), lin(:,2) + pos .* sin(ang)];
>   else
>     error('pointOnLine(line,d), arg d must be a point or a scalar');
>   endif
> endfunction;
>
> Tom Dean
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-octave

Tom,

Where do you got that it acepts a point? This is the text string
-- Function File: POINT = pointOnLine (LINE, D)
     Create a point on a line at a given position on the line.

     Creates the point belonging to the line LINE, and located at the
     distance D from the line origin.  LINE has the form [x0 y0 dx dy].
     LINE and D should have the same number N of rows.  The result will
     have N rows and 2 column (x and y positions).

NO option to pass a point, only a distance.



reply via email to

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