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 p1,
Coordinate p2,
Coordinate q)
Computes the orientation of a point q to the directed line segment p1-p2.
|
static double |
distanceLineLine(Coordinate A,
Coordinate B,
Coordinate C,
Coordinate D)
Computes the distance from a line segment AB to a line segment CD
Note: NON-ROBUST!
|
static boolean |
isCCW(Coordinate[] ring)
Computes whether a ring defined by an array of
Coordinate is
oriented counter-clockwise. |
static boolean |
isPointInRing(Coordinate p,
Coordinate[] ring)
Computes whether a ring defined by an array of
Coordinate is
oriented counter-clockwise. |
static int |
orientationIndex(Coordinate p1,
Coordinate p2,
Coordinate q)
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, signedArea
public static boolean isPointInRing(Coordinate p, Coordinate[] ring)
Coordinate
is
oriented counter-clockwise.
This will handle coordinate lists which contain repeated points.
ring
- an array of coordinates forming a ringtrue
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 ringtrue
if the ring is oriented counter-clockwise.IllegalArgumentException
- if the ring is degenerate (does not contain 3 different points)public static int computeOrientation(Coordinate p1, Coordinate p2, Coordinate q)
public static int orientationIndex(Coordinate p1, Coordinate p2, Coordinate q)
q
relative to
a vector specified by p1-p2
.p1
- the origin point of the vectorp2
- the final point of the vectorq
- the point to compute the direction topublic static double distanceLineLine(Coordinate A, Coordinate B, Coordinate C, Coordinate D)
A
- a point of one lineB
- the second point of (must be different to A)C
- one point of the lineD
- another point of the line (must be different to A)Copyright © 2016. All rights reserved.