Class DistanceComputer
- Namespace
- NetTopologySuite.Algorithm
- Assembly
- NetTopologySuite.dll
Functions to compute distance between basic geometric structures.
public static class DistanceComputer
- Inheritance
-
DistanceComputer
- Inherited Members
Methods
PointToLinePerpendicular(Coordinate, Coordinate, Coordinate)
Computes the perpendicular distance from a point p to the (infinite) line containing the points AB
public static double PointToLinePerpendicular(Coordinate p, Coordinate A, Coordinate B)
Parameters
p
CoordinateThe point to compute the distance for
A
CoordinateThe first point of the first line
B
CoordinateThe second point of the first line (must be different to A)
Returns
- double
The perpendicular distance from p to line segment AB
PointToSegment(Coordinate, Coordinate, Coordinate)
Computes the distance from a point p to a line segment AB
Note: NON-ROBUST!public static double PointToSegment(Coordinate p, Coordinate A, Coordinate B)
Parameters
p
CoordinateThe point to compute the distance for
A
CoordinateThe first point of the first line
B
CoordinateThe second point of the first line (must be different to A)
Returns
- double
The distance from p to line segment AB
PointToSegmentString(Coordinate, CoordinateSequence)
Computes the distance from a point to a sequence of line segments.
public static double PointToSegmentString(Coordinate p, CoordinateSequence line)
Parameters
p
CoordinateA point
line
CoordinateSequenceA sequence of contiguous line segments defined by their vertices
Returns
- double
The minimum distance between the point and the line segments
PointToSegmentString(Coordinate, Coordinate[])
Computes the distance from a point to a sequence of line segments.
public static double PointToSegmentString(Coordinate p, Coordinate[] line)
Parameters
p
CoordinateA point
line
Coordinate[]A sequence of contiguous line segments defined by their vertices
Returns
- double
The minimum distance between the point and the line segments
SegmentToSegment(Coordinate, Coordinate, Coordinate, Coordinate)
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)
Parameters
A
CoordinateThe first point of the first line
B
CoordinateThe second point of the first line (must be different to A)
C
CoordinateThe first point of the second line
D
CoordinateThe second point of the second line (must be different to C)
Returns
- double
The distance from a line segment AB to a line segment CD