Search Results for

    Show / Hide Table of Contents

    Class IntersectionComputer

    Functions to compute intersection points between lines and line segments.

    In general it is not possible to compute the intersection point of two lines exactly, due to numerical roundoff. This is particularly true when the lines are nearly parallel. These routines uses numerical conditioning on the input values to ensure that the computed value is very close to the correct value.

    The Z-ordinate is ignored, and not populated.
    Inheritance
    object
    IntersectionComputer
    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 class IntersectionComputer
    Remarks

    NOTE: In JTS this function is called Intersection.

    Methods

    | Edit this page View Source

    Intersection(Coordinate, Coordinate, Coordinate, Coordinate)

    Computes the intersection point of two lines. If the lines are parallel or collinear this case is detected and null is returned.

    Declaration
    public static Coordinate Intersection(Coordinate p1, Coordinate p2, Coordinate q1, Coordinate q2)
    Parameters
    Type Name Description
    Coordinate p1

    An endpoint of line 1

    Coordinate p2

    An endpoint of line 1

    Coordinate q1

    An endpoint of line 2

    Coordinate q2

    An endpoint of line 2

    Returns
    Type Description
    Coordinate

    The intersection point between the lines, if there is one, or null if the lines are parallel or collinear

    See Also
    Intersection(Coordinate, Coordinate, Coordinate, Coordinate)
    | Edit this page View Source

    LineSegment(Coordinate, Coordinate, Coordinate, Coordinate)

    Computes the intersection point of a line and a line segment (if any). There will be no intersection point if:

    If the segment is collinear with the line the first segment endpoint is returned.

    Declaration
    public static Coordinate LineSegment(Coordinate line1, Coordinate line2, Coordinate seg1, Coordinate seg2)
    Parameters
    Type Name Description
    Coordinate line1
    Coordinate line2
    Coordinate seg1
    Coordinate seg2
    Returns
    Type Description
    Coordinate

    The intersection point, or null if it is not possible to find an intersection

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