Commit 06cce78c authored by Thomas Roy's avatar Thomas Roy
Browse files

no approximation we're so good

parent 76e13bb9
function corner = check_corner(i0,i1,A,y)
function corner = check_corner(i0,i1,A,y, inc)
m = size(y,1);
C = zeros(m);
C(1:m-2,1:m-2) = A;
......@@ -6,7 +6,9 @@ D = C'+C;
% going from x0 to x1
[~,nodes] = find(D(i1,:));
nodes = nodes(nodes~=i0); %remove existing edge if it exists
if inc==1
nodes = nodes(nodes~=i0); %remove existing edge if it exists
end
j = 1;
theta = zeros(length(nodes),1);
for k=nodes
......
......@@ -35,8 +35,8 @@ for i=1:n+2
corners = 1;
else
% check if outgoing nodes are corners
node_corner = check_corner(i,node,A+A',x);
outgoing_corner = check_corner(node,i,A+A',x);
node_corner = check_corner(i,node,A+A',x,1);
outgoing_corner = check_corner(node,i,A+A',x,0);
corners = node_corner | outgoing_corner;
end
......
......@@ -5,4 +5,17 @@ hold on
G2 = graph(A+A');
plot(G2, 'XData',x(:,1),'YData',x(:,2))
xlim([0,1])
ylim([0,1])
\ No newline at end of file
ylim([0,1])
%%
figure
plot(G2, 'XData',x(:,1),'YData',x(:,2));
A_path = zeros(n+2);
for i=1:length(path)-1
A_path(path(i),path(i+1)) = 1;
end
hold on
G3 = graph(A_path+A_path');
plot(G3, 'XData',y(:,1),'YData',y(:,2),'LineWidth',1.5,'EdgeColor','g');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment