function bresline(x1,y1,x2,y2,color)
hold on
dx = x2-x1;
dy = y2-y1;
x = x1;
y = y1;
c1 = 2*dy;
error = 2*dy-dx ;
c2 = error-dx;
while x <= x2
      image(x,y,color)
      x = x+1;
      if error < 0
         error = error + c1;
      else
         y = y+1;
         error = error + c2;
      end
end