Class Intersection
java.lang.Object
org.locationtech.jts.algorithm.Intersection
Contains functions to compute intersections between lines.
- Author:
- Martin Davis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Coordinateintersection(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2) Computes the intersection point of two lines.
-
Constructor Details
-
Intersection
public Intersection()
-
-
Method Details
-
intersection
Computes the intersection point of two lines. If the lines are parallel or collinear this case is detected andnullis returned.In general it is not possible to accurately compute the intersection point of two lines, due to numerical roundoff. This is particularly true when the input lines are nearly parallel. This routine uses numerical conditioning on the input values to ensure that the computed value should be very close to the correct value.
- Parameters:
p1- an endpoint of line 1p2- an endpoint of line 1q1- an endpoint of line 2q2- an endpoint of line 2- Returns:
- the intersection point between the lines, if there is one, or null if the lines are parallel or collinear
- See Also:
-