function lineSegmentAtPoint(point, lp1, lp2) {
  var dydx = (lp2.y - lp1.y) / (lp2.x - lp1.x);
  var fx = {
    value: lp1.x + dydx * (point.x - lp1.x),
    gradient: dydx
  };

  return fx;
}
/**
* Returns the y value of the line segment at the x value of the point.
*
* @param {Object} point - The point being queried.
* @param {Object} lp1 - The first point of the line segment.
* @param {Object} lp2 - The second point of the line segment.
* @return {Object} An object containing the y value as well as the gradient of the line segment.
*/
Returns the y value of the line segment at the x value of the point.
Returns the y value of the line segment at the x value of the point .
function lineSegmentAtPoint(point, lp1, lp2) {
  var dydx = (lp2.y - lp1.y) / (lp2.x - lp1.x);
  var fx = {
    value: lp1.x + dydx * (point.x - lp1.x),
    gradient: dydx
  };
  return fx;
}
function lineSegmentAtPoint ( point , lp1 , lp2 ) { var dydx = ( lp2 . y - lp1 . y ) / ( lp2 . x - lp1 . x ) ; var fx = { value : lp1 . x + dydx * ( point . x - lp1 . x ) , gradient : dydx } ; return fx ; }
Returns the y value of the line segment at the x value of the point.
Returns the y value of the line segment at the x value of the point .