How to implement a pipeline?

I’m assuming that the original poster is looking to draw lines, not use c# pipelines.

var can;
var ctx;

function init(){
  can=document.getElementById("Canvas");
  ctx=can.getContext("2d");
  ctx.canvas.width  = window.innerWidth;
  ctx.canvas.height = window.innerHeight;
  DrawSlope(1,20);
}

function DrawSlope(x,y)
{
   var firstPoint = [x,0];
   var secondPoint = [1,x+y];

WritePointToHTML(firstPoint[0],firstPoint[1],secondPoint[0],secondPoint[1]);
}

function WritePointToHTML(x,y,xTwo,yTwo)
{
ctx.beginPath();
ctx.moveTo(x, y);
ctx.lineTo(xTwo, yTwo);
ctx.stroke();
}

// added “draw slope” to factor in slope formula.
https://codepen.io/hollyeplyler/pen/gqYyZx

Leave a Comment