Search Results for

    Show / Hide Table of Contents

    Class DistanceComputer

    Functions to compute distance between basic geometric structures.

    Inheritance
    object
    DistanceComputer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Algorithm
    Assembly: NetTopologySuite.dll
    Syntax
    public static class DistanceComputer

    Methods

    | Edit this page View Source

    PointToLinePerpendicular(Coordinate, Coordinate, Coordinate)

    Computes the perpendicular distance from a point p to the (infinite) line containing the points AB

    Declaration
    public static double PointToLinePerpendicular(Coordinate p, Coordinate A, Coordinate B)
    Parameters
    Type Name Description
    Coordinate p

    The point to compute the distance for

    Coordinate A

    The first point of the first line

    Coordinate B

    The second point of the first line (must be different to A)

    Returns
    Type Description
    double

    The perpendicular distance from p to line segment AB

    | Edit this page View Source

    PointToLinePerpendicularSigned(Coordinate, Coordinate, Coordinate)

    Computes the perpendicular distance from a point p to the (infinite) line containing the points AB. The result is positive if to the left, otherwise negative.

    Declaration
    public static double PointToLinePerpendicularSigned(Coordinate p, Coordinate A, Coordinate B)
    Parameters
    Type Name Description
    Coordinate p

    The point to compute the distance for

    Coordinate A

    The first point of the first line

    Coordinate B

    The second point of the first line (must be different to A)

    Returns
    Type Description
    double

    The perpendicular distance from p to line segment AB

    | Edit this page View Source

    PointToSegment(Coordinate, Coordinate, Coordinate)

    Computes the distance from a point p to a line segment AB

    Note: NON-ROBUST!
    Declaration
    public static double PointToSegment(Coordinate p, Coordinate A, Coordinate B)
    Parameters
    Type Name Description
    Coordinate p

    The point to compute the distance for

    Coordinate A

    The first point of the first line

    Coordinate B

    The second point of the first line (must be different to A)

    Returns
    Type Description
    double

    The distance from p to line segment AB

    | Edit this page View Source

    PointToSegmentString(Coordinate, CoordinateSequence)

    Computes the distance from a point to a sequence of line segments.

    Declaration
    public static double PointToSegmentString(Coordinate p, CoordinateSequence line)
    Parameters
    Type Name Description
    Coordinate p

    A point

    CoordinateSequence line

    A sequence of contiguous line segments defined by their vertices

    Returns
    Type Description
    double

    The minimum distance between the point and the line segments

    | Edit this page View Source

    PointToSegmentString(Coordinate, Coordinate[])

    Computes the distance from a point to a sequence of line segments.

    Declaration
    public static double PointToSegmentString(Coordinate p, Coordinate[] line)
    Parameters
    Type Name Description
    Coordinate p

    A point

    Coordinate[] line

    A sequence of contiguous line segments defined by their vertices

    Returns
    Type Description
    double

    The minimum distance between the point and the line segments

    | Edit this page View Source

    SegmentToSegment(Coordinate, Coordinate, Coordinate, Coordinate)

    Computes the distance from a line segment AB to a line segment CD

    Note: NON-ROBUST!
    Declaration
    public static double SegmentToSegment(Coordinate A, Coordinate B, Coordinate C, Coordinate D)
    Parameters
    Type Name Description
    Coordinate A

    The first point of the first line

    Coordinate B

    The second point of the first line (must be different to A)

    Coordinate C

    The first point of the second line

    Coordinate D

    The second point of the second line (must be different to C)

    Returns
    Type Description
    double

    The distance from a line segment AB to a line segment CD

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX