private boolean isCCW(GeoPoint a, GeoPoint b, GeoPoint c) { Point i = a.toPoint(1.0); Point j = b.toPoint(1.0); Point k = c.toPoint(1.0); Vector cross = Vector.cross(i, j, k).normalize(); Point l = i.translate(cross); double d = Vector.computeDistance(l.x, l.y, l.z); return d < 1.0; }
public long findBetween(GeoPoint pointA, GeoPoint pointB) { Point a = pointA.toPoint(1000.0); Point b = pointB.toPoint(1000.0); double x = (a.x + b.x) * 0.5; double y = (a.y + b.y) * 0.5; double z = (a.z + b.z) * 0.5; double l = 1000.0 / Vector.computeDistance(x, y, z); x *= l; y *= l; z *= l; assert Math.abs( Vector.computeDistance(a.x - x, a.y - y, a.z - z) - Vector.computeDistance(b.x - x, b.y - y, b.z - z)) < 0.0005; globalPointMap.intersect(bounds.load(x, y, z), this.reset()); assert found; assert globalPointEntry.getSeq() >= 0; return globalPointEntry.getSeq(); }