[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49851] Plot error when using geometry functio
From: |
Juan Pablo Carbajal |
Subject: |
[Octave-bug-tracker] [bug #49851] Plot error when using geometry functions |
Date: |
Thu, 15 Dec 2016 14:19:58 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.75 Safari/537.36 |
Follow-up Comment #2, bug #49851 (project octave):
The following code works for me without problems. Output attached
Note the changes I have made to the original code. This is more efficient and
it is correct if the intention is to calculate the intersection of the Edges
and the circle.
A function intersectEdgeCircle could be added to the package.
#to find the start point find the closest point on the lines
[idx d] = findClosestPoint (centblock, fieldblock2);
startpoint = fieldblock2(idx,[1,2]);
#for each innerline, pick up points2d
CIRCLE = createCircle (startpoint, startpoint+beehiverange);
pCIRCLE = circleAsPolygon (CIRCLE);
figure(1)
clf
drawCircle (CIRCLE);
hold on
drawPoint (startpoint);
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);
if (any(isnan(EDGE))); waring("NAN edge %d", z); endif
drawEdge (EDGE);
#pts = intersectLineCircle(edgeToLine(EDGE),CIRCLE);
pts = intersectEdgePolygon (EDGE, pCIRCLE);
drawPoint (pts,"ro");
endfor
axis image
hold off
(file #39237)
_______________________________________________________
Additional Item Attachment:
File name: edge_circle_intersect.png Size:13 KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49851>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/