Código Javascript:
Ver original
function crearLinea(x1,y1,x2,y2) { $(document).on("ready" ,function(){ $('canvas').drawLine({ strokeStyle: '#000', strokeWidth: 2, x1: x1, y1: y1, x2: x2, y2: y2, }); }); } crearLinea(150,0,150,300); crearLinea(0,75,300,75); function graficar(m,b) { var x1 = (150 - b)/m; var x2 = (-150 - b)/m; x1 = (x1+150); x2 = (x2+150); crearLinea(x1,0,x2,150) }