Midpoint line algorithm void midpointLine (into, intyO, intx1, inty 1, value) int dx, dy, incrE, incrNE, d, x, y dy=y1y0;dX=×1-×0;d=dy*2-dX incrE=dy *2; incrNE=(dy-dx) *2 XEX0; y=yO: WritePixel(x, y, value) while(X<x1)i if(d<=0)d+=incrE; X++ else d+=incrNE, X++; y++ Write Pixel(x, y, value)Midpoint Line Algorithm void MidpointLine(intx0, inty0, intx1, inty1, value) { int dx, dy, incrE, incrNE, d, x, y; dy=y1-y0;dx=x1-x0;d=dy*2-dx; incrE=dy*2;incrNE=(dy-dx)*2; x=x0;y=y0; WritePixel(x, y, value); while(x<x1) { if(d<=0) {d+=incrE;x++; } else {d+=incrNE;x++;y++; } WritePixel(x, y, value); } }