private static class ConvexHull.RadialComparator
extends java.lang.Object
implements java.util.Comparator
Coordinate
s for their angle and distance
relative to an origin.Modifier and Type | Field and Description |
---|---|
private Coordinate |
origin |
Constructor and Description |
---|
RadialComparator(Coordinate origin) |
Modifier and Type | Method and Description |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2) |
private static int |
polarCompare(Coordinate o,
Coordinate p,
Coordinate q)
Given two points p and q compare them with respect to their radial
ordering about point o.
|
private Coordinate origin
public RadialComparator(Coordinate origin)
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
private static int polarCompare(Coordinate o, Coordinate p, Coordinate q)
p < q iff
o
- the originp
- a pointq
- another point