Here is the snippet for drawing a line in javascript. function drawline(xa,ya,xb,yb){ var dx=Math.abs(xa-xb); var dy=Math.abs(ya-yb); var p=2*dy-dx; var twody=2*dy; var twodydx=2*(dy-dx); var x,y,xend;
Come and explore with me
Here is the snippet for drawing a line in javascript. function drawline(xa,ya,xb,yb){ var dx=Math.abs(xa-xb); var dy=Math.abs(ya-yb); var p=2*dy-dx; var twody=2*dy; var twodydx=2*(dy-dx); var x,y,xend;