help-octave
[Top][All Lists]

## RE: Geometry package Octave

 From: Andrew Lewis Subject: RE: Geometry package Octave Date: Fri, 28 Oct 2016 12:25:13 +0100

```Hi,

Firstly many thanks for your response. I am using Geometry version 2.1.1 and
Mapping 1.2.1 with Octave 4.0.3.

Herewith attached is my code which runs. I only want those points which
intersect the circles and the edges?

Many thanks,

Andrew J Lewis MSc FLS
Director
www.simulsystemsltd.co.uk
Chelmsford, UK.
44-(0)7710 588318

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Juan Pablo Carbajal
Sent: 28 October 2016 12:00
To: simulsys; Help GNU Octave
Subject: Re: Geometry package Octave

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.
My answers below (try to answer below my message as well)

On Thu, Oct 27, 2016 at 12:15 PM, Andrew Lewis <address@hidden> wrote:
> 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 apart? (please see attached). Please see the code
> below:
>
>
>
> 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
>
>
>
> Can you help please?
>
>
>
> 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?
```

beeswax6_01.m
Description: Binary data

reply via email to