public class NonRobustCGAlgorithms extends CGAlgorithms
CLOCKWISE, COLLINEAR, COUNTERCLOCKWISE, LEFT, RIGHT, STRAIGHT| Constructor and Description |
|---|
NonRobustCGAlgorithms()
|
| Modifier and Type | Method and Description |
|---|---|
static int |
computeOrientation(Coordinate
Computes the orientation of a point q to the directed line segment p1-p2.
|
static double |
distanceLineLine(Coordinate
Computes the distance from a line segment AB to a line segment CD Note: NON-ROBUST!
|
static boolean |
isCCW(Coordinate
Computes whether a ring defined by an array of
Coordinate is oriented counter-clockwise.
|
static boolean |
isPointInRing(Coordinate
Computes whether a ring defined by an array of
Coordinate is oriented counter-clockwise.
|
static int |
orientationIndex(Coordinate
Returns the index of the direction of the point
q relative to a vector specified by
p1-p2.
|
distancePointLine, distancePointLine, distancePointLinePerpendicular, isOnLine, length, locatePointInRing, signedArea, signedAreapublic static boolean isPointInRing(Coordinatep, Coordinate [] ring)
Coordinate is oriented counter-clockwise.
This will handle coordinate lists which contain repeated points.
ring - an array of coordinates forming a ring
true if the ring is oriented counter-clockwise.
IllegalArgumentException - if the ring is degenerate (does not contain 3 different points)
public static boolean isCCW(Coordinate[] ring)
Coordinate is oriented counter-clockwise.
This will handle coordinate lists which contain repeated points.
ring - an array of coordinates forming a ring
true if the ring is oriented counter-clockwise.
IllegalArgumentException - if the ring is degenerate (does not contain 3 different points)
public static int computeOrientation(Coordinatep1, Coordinate p2, Coordinate q)
public static int orientationIndex(Coordinatep1, Coordinate p2, Coordinate q)
q relative to a vector specified by
p1-p2.
p1 - the origin point of the vector
p2 - the final point of the vector
q - the point to compute the direction to
public static double distanceLineLine(CoordinateA, Coordinate B, Coordinate C, Coordinate D)
A - a point of one line
B - the second point of (must be different to A)
C - one point of the line
D - another point of the line (must be different to A)