|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bbn.openmap.geo.ConvexHull
public class ConvexHull
This class contains static methods that can be used to create convex hull GeoRegions from arrays of Geos. The only algorithm implemented is Graham's, where the highest point is selected (called the pivot), the other points are sorted according to their relative azimuths from the pivot, and then a path is created around the other points. Any right turn encountered traversing the points means that point should be skipped when creating the convex hull.
Nested Class Summary | |
---|---|
protected static class |
ConvexHull.PivotAngleComparator
|
Method Summary | |
---|---|
protected static Geo |
findHighest(Geo[] geos)
|
static GeoRegion |
getRegion(Geo[] geos)
Using Graham's scan. |
static Geo[] |
hull(Geo[] geos)
Using Graham's scan. |
static Geo[] |
hull(Geo[] geos,
double tolerance)
Using Graham's scan. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static final GeoRegion getRegion(Geo[] geos)
geos
-
public static final Geo[] hull(Geo[] geos)
geos
-
public static final Geo[] hull(Geo[] geos, double tolerance)
geos
- tolerance
- the distance between points where they would be
considered equals, in radians.
protected static Geo findHighest(Geo[] geos)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |