%COMP 256 Assignment 2
%Adrian Ilie

function drawline(line,minc,maxc)
a=line(1);
b=line(2);
c=line(3);

if (b ~= 0) %regular line
    p1x = minc(2);
    p1y = (-a * p1x - c) / b;
    p2x = maxc(2);
    p2y = (-a * p2x - c) / b;
else %vertical line
    p1y = minc(1);
    p1x = (-b * p1y - c) / a;
    p2y = maxc(1);
    p2x = (-b * p2y - c) / a;
end;

plot([p1x,p2x],[p1y,p2y], 'w');

