Search Results for

    Show / Hide Table of Contents

    Class TrianglePredicate

    Algorithms for computing values and predicates associated with triangles.

    Inheritance
    object
    TrianglePredicate
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Triangulate.QuadEdge
    Assembly: NetTopologySuite.dll
    Syntax
    public static class TrianglePredicate
    Remarks

    For some algorithms extended-precision implementations are provided, which are more robust (i.e. they produce correct answers in more cases). Also, some more robust formulations of some algorithms are provided, which utilize normalization to the origin.

    Methods

    | Edit this page View Source

    IsInCircleCC(Coordinate, Coordinate, Coordinate, Coordinate)

    Computes the inCircle test using distance from the circumcentre. Uses standard double-precision arithmetic.

    Declaration
    public static bool IsInCircleCC(Coordinate a, Coordinate b, Coordinate c, Coordinate p)
    Parameters
    Type Name Description
    Coordinate a

    A vertex of the triangle

    Coordinate b

    A vertex of the triangle

    Coordinate c

    A vertex of the triangle

    Coordinate p

    The point to test

    Returns
    Type Description
    bool

    The area of a triangle defined by the points a, b and c

    Remarks

    In general this doesn't appear to be any more robust than the standard calculation. However, there is at least one case where the test point is far enough from the circumcircle that this test gives the correct answer.

    LINESTRING (1507029.9878 518325.7547, 1507022.1120341457 518332.8225183258,
    1507029.9833 518325.7458, 1507029.9896965567 518325.744909031)
    
    | Edit this page View Source

    IsInCircleDDFast(Coordinate, Coordinate, Coordinate, Coordinate)

    Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).

    Declaration
    public static bool IsInCircleDDFast(Coordinate a, Coordinate b, Coordinate c, Coordinate p)
    Parameters
    Type Name Description
    Coordinate a

    A vertex of the triangle

    Coordinate b

    A vertex of the triangle

    Coordinate c

    A vertex of the triangle

    Coordinate p

    The point to test

    Returns
    Type Description
    bool

    true if this point is inside the circle defined by the points a, b, c

    Remarks

    The computation uses DD arithmetic for robustness, but a faster approach.

    | Edit this page View Source

    IsInCircleDDNormalized(Coordinate, Coordinate, Coordinate, Coordinate)

    Declaration
    public static bool IsInCircleDDNormalized(Coordinate a, Coordinate b, Coordinate c, Coordinate p)
    Parameters
    Type Name Description
    Coordinate a
    Coordinate b
    Coordinate c
    Coordinate p
    Returns
    Type Description
    bool
    | Edit this page View Source

    IsInCircleNonRobust(Coordinate, Coordinate, Coordinate, Coordinate)

    Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise). This test uses simple double-precision arithmetic, and thus is not 100% robust.

    Declaration
    public static bool IsInCircleNonRobust(Coordinate a, Coordinate b, Coordinate c, Coordinate p)
    Parameters
    Type Name Description
    Coordinate a

    A vertex of the triangle

    Coordinate b

    A vertex of the triangle

    Coordinate c

    A vertex of the triangle

    Coordinate p

    The point to test

    Returns
    Type Description
    bool

    true if this point is inside the circle defined by the points a, b, c

    | Edit this page View Source

    IsInCircleNormalized(Coordinate, Coordinate, Coordinate, Coordinate)

    Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).

    Declaration
    public static bool IsInCircleNormalized(Coordinate a, Coordinate b, Coordinate c, Coordinate p)
    Parameters
    Type Name Description
    Coordinate a

    A vertex of the triangle

    Coordinate b

    A vertex of the triangle

    Coordinate c

    A vertex of the triangle

    Coordinate p

    The point to test

    Returns
    Type Description
    bool

    true if this point is inside the circle defined by the points a, b, c

    Remarks

    This test uses simple double-precision arithmetic, and thus is not 100% robust. However, by using normalization to the origin it provides improved robustness and increased performance.

    Based on code by J.R.Shewchuk.

    | Edit this page View Source

    IsInCircleRobust(Coordinate, Coordinate, Coordinate, Coordinate)

    Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).

    Declaration
    public static bool IsInCircleRobust(Coordinate a, Coordinate b, Coordinate c, Coordinate p)
    Parameters
    Type Name Description
    Coordinate a

    A vertex of the triangle

    Coordinate b

    A vertex of the triangle

    Coordinate c

    A vertex of the triangle

    Coordinate p

    The point to test

    Returns
    Type Description
    bool

    true if this point is inside the circle defined by the points a, b, c

    Remarks

    This method uses more robust computation.

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