lineIntersection method

Coordinate? lineIntersection(
  1. LineSegment line
)

Computes the intersection point of the lines of infinite extent defined by two line segments (if there is one). There may be 0, 1 or an infinite number of intersection points between two lines. If there is a unique intersection point, it is returned. Otherwise, null is returned. If more information is required about the details of the intersection, the {@link RobustLineIntersector} class should be used.

@param line a line segment defining an straight line with infinite extent @return an intersection point, or null if there is no point of intersection or an infinite number of intersection points

@see RobustLineIntersector

Implementation

Coordinate? lineIntersection(LineSegment line) {
  Coordinate? intPt = Intersection.intersection(p0, p1, line.p0, line.p1);
  return intPt;
}