Class Distance
java.lang.Object
org.locationtech.jts.algorithm.Distance
Functions to compute distance between basic geometric structures.
- Author:
- Martin Davis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doubleComputes the perpendicular distance from a point p to the (infinite) line containing the points ABstatic doublestatic doublepointToSegment(Coordinate p, Coordinate A, Coordinate B) Computes the distance from a point p to a line segment AB Note: NON-ROBUST!static doublepointToSegmentString(Coordinate p, Coordinate[] line) Computes the distance from a point to a sequence of line segments.static doublesegmentToSegment(Coordinate A, Coordinate B, Coordinate C, Coordinate D) Computes the distance from a line segment AB to a line segment CD Note: NON-ROBUST!
-
Constructor Details
-
Distance
public Distance()
-
-
Method Details
-
segmentToSegment
Computes the distance from a line segment AB to a line segment CD Note: NON-ROBUST!- Parameters:
A- a point of one lineB- the second point of (must be different to A)C- one point of the lineD- another point of the line (must be different to A)
-
pointToSegmentString
Computes the distance from a point to a sequence of line segments.- Parameters:
p- a pointline- a sequence of contiguous line segments defined by their vertices- Returns:
- the minimum distance between the point and the line segments
-
pointToSegment
Computes the distance from a point p to a line segment AB Note: NON-ROBUST!- Parameters:
p- the point to compute the distance forA- one point of the lineB- another point of the line (must be different to A)- Returns:
- the distance from p to line segment AB
-
pointToLinePerpendicular
Computes the perpendicular distance from a point p to the (infinite) line containing the points AB- Parameters:
p- the point to compute the distance forA- one point of the lineB- another point of the line (must be different to A)- Returns:
- the distance from p to line AB
-
pointToLinePerpendicularSigned
-