computeIntersectionPointLine method

void computeIntersectionPointLine(
  1. Coordinate p,
  2. Coordinate p1,
  3. Coordinate p2
)
override

Compute the intersection of a point p and the line p1-p2. This function computes the bool value of the hasIntersection test. The actual value of the intersection (if there is one) is equal to the value of p.

Implementation

void computeIntersectionPointLine(
    Coordinate p, Coordinate p1, Coordinate p2) {
  _isProper = false;
  // do between check first, since it is faster than the orientation test
  if (Envelope.intersectsPoint(p1, p2, p)) {
    if ((Orientation.index(p1, p2, p) == 0) &&
        (Orientation.index(p2, p1, p) == 0)) {
      _isProper = true;
      if (p.equals(p1) || p.equals(p2)) {
        _isProper = false;
      }
      result = LineIntersector.POINT_INTERSECTION;
      return;
    }
  }
  result = LineIntersector.NO_INTERSECTION;
}