public class OrientedCoordinateArray
extends java.lang.Object
implements java.lang.Comparable
Coordinate arrays
in an orientation-independent way.| Modifier and Type | Field and Description |
|---|---|
private boolean |
orientation |
private Coordinate[] |
pts |
| Constructor and Description |
|---|
OrientedCoordinateArray(Coordinate[] pts)
Creates a new
OrientedCoordinateArray
for the given Coordinate array. |
| Modifier and Type | Method and Description |
|---|---|
private static int |
compareOriented(Coordinate[] pts1,
boolean orientation1,
Coordinate[] pts2,
boolean orientation2) |
int |
compareTo(java.lang.Object o1)
Compares two
OrientedCoordinateArrays for their relative order |
private static boolean |
orientation(Coordinate[] pts)
Computes the canonical orientation for a coordinate array.
|
private Coordinate[] pts
private boolean orientation
public OrientedCoordinateArray(Coordinate[] pts)
OrientedCoordinateArray
for the given Coordinate array.pts - the coordinates to orientprivate static boolean orientation(Coordinate[] pts)
pts - the array to testtrue if the points are oriented forwards
or false
public int compareTo(java.lang.Object o1)
OrientedCoordinateArrays for their relative ordercompareTo in interface java.lang.Comparableprivate static int compareOriented(Coordinate[] pts1, boolean orientation1, Coordinate[] pts2, boolean orientation2)