comparePoint (point) {
    if (this.isAnEndpoint(point)) return 0
    const interPt = closestPoint(this.leftSE.point, this.rightSE.point, point)

    if (point.y < interPt.y) return -1
    if (point.y > interPt.y) return 1

    // depending on if our segment angles up or down,
    // the x coord comparison means oppposite things
    if (point.x < interPt.x) {
      if (this.leftSE.point.y < this.rightSE.point.y) return 1
      if (this.leftSE.point.y > this.rightSE.point.y) return -1
    }
    if (point.x > interPt.x) {
      if (this.leftSE.point.y < this.rightSE.point.y) return -1
      if (this.leftSE.point.y > this.rightSE.point.y) return 1
    }

    // on the line
    return 0
  }
/* Compare this segment with a point. Return value indicates:
   *     1: point lies above or to the left of segment
   *     0: point is colinear to segment
   *    -1: point is below or to the right of segment */
Compare this segment with a point. Return value indicates:
1: point lies above or to the left of segment
0: point is colinear to segment
-1: point is below or to the right of segment
Compare this segment with a point . Return value indicates : 1 : point lies above or to the left of segment 0 : point is colinear to segment - 1 : point is below or to the right of segment
comparePoint (point) {
    if (this.isAnEndpoint(point)) return 0
    const interPt = closestPoint(this.leftSE.point, this.rightSE.point, point)
    if (point.y < interPt.y) return -1
    if (point.y > interPt.y) return 1
    if (point.x < interPt.x) {
      if (this.leftSE.point.y < this.rightSE.point.y) return 1
      if (this.leftSE.point.y > this.rightSE.point.y) return -1
    }
    if (point.x > interPt.x) {
      if (this.leftSE.point.y < this.rightSE.point.y) return -1
      if (this.leftSE.point.y > this.rightSE.point.y) return 1
    }
    return 0
  }
comparePoint ( point ) { if ( this . isAnEndpoint ( point ) ) return 0 const interPt = closestPoint ( this . leftSE . point , this . rightSE . point , point ) if ( point . y < interPt . y ) return - 1 if ( point . y > interPt . y ) return 1 if ( point . x < interPt . x ) { if ( this . leftSE . point . y < this . rightSE . point . y ) return 1 if ( this . leftSE . point . y > this . rightSE . point . y ) return - 1 } if ( point . x > interPt . x ) { if ( this . leftSE . point . y < this . rightSE . point . y ) return - 1 if ( this . leftSE . point . y > this . rightSE . point . y ) return 1 } return 0 }
Compare this segment with a point.
Compare this segment with a point .
// depending on if our segment angles up or down, // the x coord comparison means oppposite things // on the line