public class Distance extends Object
| Constructor and Description |
|---|
Distance() |
| Modifier and Type | Method and Description |
|---|---|
static double |
pointToLinePerpendicular(Coordinate p,
Coordinate A,
Coordinate B)
Computes the perpendicular distance from a point p to the (infinite) line
containing the points AB
|
static double |
pointToLinePerpendicularSigned(Coordinate p,
Coordinate A,
Coordinate B) |
static double |
pointToSegment(Coordinate p,
Coordinate A,
Coordinate B)
Computes the distance from a point p to a line segment AB
Note: NON-ROBUST!
|
static double |
pointToSegmentString(Coordinate p,
Coordinate[] line)
Computes the distance from a point to a sequence of line segments.
|
static double |
segmentToSegment(Coordinate A,
Coordinate B,
Coordinate C,
Coordinate D)
Computes the distance from a line segment AB to a line segment CD
Note: NON-ROBUST!
|
public static double segmentToSegment(Coordinate A, Coordinate B, Coordinate C, Coordinate D)
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)public static double pointToSegmentString(Coordinate p, Coordinate[] line)
p - a pointline - a sequence of contiguous line segments defined by their verticespublic static double pointToSegment(Coordinate p, Coordinate A, Coordinate B)
p - the point to compute the distance forA - one point of the lineB - another point of the line (must be different to A)public static double pointToLinePerpendicular(Coordinate p, Coordinate A, Coordinate B)
p - the point to compute the distance forA - one point of the lineB - another point of the line (must be different to A)public static double pointToLinePerpendicularSigned(Coordinate p, Coordinate A, Coordinate B)
Copyright © 2024. All rights reserved.