projection = (pt, l1, l2) => {
  const p = sub(pt, l1), q = sub(l2, l1);
  if (q[0] === 0 && q[1] === 0) return [ l1[0], l1[1] ];
  const projVec = mul(dot(p, q)/dot(q, q), q);
  return add(l1, projVec);
}
Project of a point on a line
@param { PointTuple } pt Point to project 
@param { PointTuple } l1 First point on the line's direction
@param { PointTuple } l2 Secode point on the line's direction
@returns { PointTuple }