function [x,y]=gnetplot(x1,x2,y1,y2)

% This function calculates vertices align on the line connecting points (x1,y1) and (x2,y2).

if x1~=x2 && y1~=y2
    sl=(y2-y1)/(x2-x1);
    dx=(x2-x1)/999;
    for i=1:1000
        x(i)=x1+(i-1)*dx;
        y(i)=y1+sl*(x(i)-x1);
    end
elseif x1~=x2 && y1==y2
    dx=(x2-x1)/999;
    for i=1:1000
        x(i)=x1+(i-1)*dx;
        y(i)=y1;
    end
elseif x1==x2 && y1~=y2
    dy=(y2-y1)/999;
    for i=1:1000
        x(i)=x1;
        y(i)=y1+(i-1)*dy;
    end
else
end

end