help-octave
[Top][All Lists]

## Re: Geometry package Octave

 From: Juan Pablo Carbajal Subject: Re: Geometry package Octave Date: Fri, 28 Oct 2016 12:59:55 +0200

```Dear Andrew,

Please send this question to the octave help mailing list (in CC, keep
them in the loop), so more people might help you. I do not have a lot
of freetime lately.

On Thu, Oct 27, 2016 at 12:15 PM, Andrew Lewis
> Hi Juan Pablo!
>
>
>
> I am using Geometry in Octave, version 4.03, and I am having catastrophic
> failure with discriminating intersect points where they reside on edges
> using intersectLineEdge(). The function does not work straightforwardly as
> it seems to discover Lines in plot as well, but I cannot discriminate them
>
>
>
> STARTS:
>
> % CODE FOR ARRAY INSTANTIATION GOES HERE>>>>
>
>
> #for each innerline, pick up points2d
>
> CIRCLE=createCircle(startpoint, startpoint+beehiverange);
>
> for z= 1:(numel(innerlines)/2-1)
>
>   w=innerlines(z,[1]);
>
>   v=innerlines(z,[2]);
>
>   newpoint1=fieldblock(w,[2:3]);
>
>   newpoint2=fieldblock(v,[2:3]);
>
>   EDGE=createEdge(newpoint1,newpoint2);
>
>   drawEdge(EDGE);
>
>   LINE=createLine(newpoint1,newpoint2);
>
>   LINE=LINE(~isnan(LINE));
>
>   EDGE=EDGE(~isnan(EDGE));
>
>   pts=intersectLineCircle(edgeToLine(EDGE),CIRCLE);
>
>   pointer1=pts(1,:);
>
>   pointer2=pts(2,:);
>
>   %if (isPointOnEdge(pointer1,EDGE) && !isPointOnEdge(pointer2,EDGE))
>
>   %if (isPointOnLine(pointer1,LINE) && !isPointOnLine(pointer2,LINE))
>
>   %if(pointer1=intersectLineEdge(LINE,EDGE))
>
>     drawPoint(pts,"ro");
>
>   %elseif (!isPointOnEdge(pointer1,EDGE) && isPointOnEdge(pointer2, EDGE))
>
>   %elseif (!isPointOnLine(pointer1,LINE) && isPointOnLine(pointer2, LINE))
>
>   %  drawPoint(pts,"go") ;
>
>   %else
>
>   %  drawPoint(pts,"yo");
>
>   %endif
>
>   hold on;
>
> endfor
>
> drawPoint(startpoint);
>
> drawCircle(CIRCLE);
>
> axis([-5 25 -5 25]);
>
> axis equal;
>
> :ENDS
>
>
>
>
>
>
> Andrew J Lewis MSc FLS
>
> Director
>
> www.simulsystemsltd.co.uk
>
> Chelmsford, UK.
>
> 44-(0)7710 588318
>
>

I couldn't test your code becasue I do not have the functions
"innerlines" and "fieldblock". Could you provde a running example?
What is the line of your code that generate the bad results?
Also, what version of geometry are you using?

```