public class TrianglePredicate extends Object
| Constructor and Description |
|---|
TrianglePredicate()
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isInCircleCC(Coordinate
Computes the inCircle test using distance from the circumcentre.
|
static boolean |
isInCircleDDFast(Coordinate
|
static boolean |
isInCircleDDNormalized(Coordinate
|
static boolean |
isInCircleDDSlow(Coordinate
Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).
|
static boolean |
isInCircleNonRobust(Coordinate
Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).
|
static boolean |
isInCircleNormalized(Coordinate
Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).
|
static boolean |
isInCircleRobust(Coordinate
Tests if a point is inside the circle defined by the triangle with vertices a, b, c (oriented counter-clockwise).
|
static DD |
triAreaDDFast(Coordinate
|
static DD |
triAreaDDSlow(DD
Computes twice the area of the oriented triangle (a, b, c), i.e., the area is positive if the triangle is oriented counterclockwise.
|
public static boolean isInCircleNonRobust(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
a - a vertex of the triangle
b - a vertex of the triangle
c - a vertex of the triangle
p - the point to test
public static boolean isInCircleNormalized(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
Based on code by J.R.Shewchuk.
a - a vertex of the triangle
b - a vertex of the triangle
c - a vertex of the triangle
p - the point to test
public static boolean isInCircleRobust(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
a - a vertex of the triangle
b - a vertex of the triangle
c - a vertex of the triangle
p - the point to test
public static boolean isInCircleDDSlow(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
DD arithmetic for robustness.
a - a vertex of the triangle
b - a vertex of the triangle
c - a vertex of the triangle
p - the point to test
public static DDtriAreaDDSlow(DD ax, DD ay, DD bx, DD by, DD cx, DD cy)
DD arithmetic for robustness.
ax - the x ordinate of a vertex of the triangle
ay - the y ordinate of a vertex of the triangle
bx - the x ordinate of a vertex of the triangle
by - the y ordinate of a vertex of the triangle
cx - the x ordinate of a vertex of the triangle
cy - the y ordinate of a vertex of the triangle
public static boolean isInCircleDDFast(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
public static DDtriAreaDDFast(Coordinate a, Coordinate b, Coordinate c)
public static boolean isInCircleDDNormalized(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
public static boolean isInCircleCC(Coordinatea, Coordinate b, Coordinate c, Coordinate p)
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)
a - a vertex of the triangle
b - a vertex of the triangle
c - a vertex of the triangle
p - the point to test