You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2016/05/19 09:35:36 UTC

[36/50] lucene-solr:jira/solr-9045: LUCENE-7288: Return POSITIVE_INFINITY for points outside of shape, not MAX_VALUE.

LUCENE-7288: Return POSITIVE_INFINITY for points outside of shape, not MAX_VALUE.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/a911eb85
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a911eb85
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a911eb85

Branch: refs/heads/jira/solr-9045
Commit: a911eb8561969998dbe72d37fae33eb44c5ac685
Parents: 07af00d
Author: Karl Wright <Da...@gmail.com>
Authored: Wed May 18 07:07:08 2016 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Wed May 18 07:07:08 2016 -0400

----------------------------------------------------------------------
 .../lucene/spatial3d/geom/GeoBaseDistanceShape.java     |  6 +++---
 .../apache/lucene/spatial3d/geom/GeoComplexPolygon.java |  6 +++---
 .../spatial3d/geom/GeoCompositeMembershipShape.java     |  2 +-
 .../apache/lucene/spatial3d/geom/GeoConcavePolygon.java |  2 +-
 .../apache/lucene/spatial3d/geom/GeoConvexPolygon.java  |  2 +-
 .../lucene/spatial3d/geom/GeoDegeneratePoint.java       |  2 +-
 .../org/apache/lucene/spatial3d/geom/GeoDistance.java   |  6 +++---
 .../apache/lucene/spatial3d/geom/GeoStandardPath.java   | 12 ++++++------
 .../java/org/apache/lucene/spatial3d/geom/Plane.java    | 12 ++++++------
 .../org/apache/lucene/spatial3d/geom/GeoCircleTest.java |  6 +++---
 .../org/apache/lucene/spatial3d/geom/GeoPathTest.java   |  8 ++++----
 11 files changed, 32 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseDistanceShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseDistanceShape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseDistanceShape.java
index ec9b6b7..82e811a 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseDistanceShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoBaseDistanceShape.java
@@ -44,7 +44,7 @@ public abstract class GeoBaseDistanceShape extends GeoBaseMembershipShape implem
   @Override
   public double computeDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
     if (!isWithin(x,y,z)) {
-      return Double.MAX_VALUE;
+      return Double.POSITIVE_INFINITY;
     }
     return distance(distanceStyle, x, y, z);
   }
@@ -54,14 +54,14 @@ public abstract class GeoBaseDistanceShape extends GeoBaseMembershipShape implem
 
   @Override
   public void getDistanceBounds(final Bounds bounds, final DistanceStyle distanceStyle, final double distanceValue) {
-    if (distanceValue == Double.MAX_VALUE) {
+    if (distanceValue == Double.POSITIVE_INFINITY) {
       getBounds(bounds);
       return;
     }
     distanceBounds(bounds, distanceStyle, distanceValue);
   }
   
-  /** Called by a {@code getDistanceBounds} method if distanceValue is not Double.MAX_VALUE. */
+  /** Called by a {@code getDistanceBounds} method if distanceValue is not Double.POSITIVE_INFINITY. */
   protected abstract void distanceBounds(final Bounds bounds, final DistanceStyle distanceStyle, final double distanceValue);
 
 }

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
index 23014f7..694c96b 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoComplexPolygon.java
@@ -171,7 +171,7 @@ class GeoComplexPolygon extends GeoBasePolygon {
       final GeoPoint[] ZIntersectionsY = travelPlaneFixedZ.findIntersections(planetModel, testPointFixedYPlane);
 
       // There will be multiple intersection points found.  We choose the one that has the lowest total distance, as measured in delta X, delta Y, and delta Z.
-      double bestDistance = Double.MAX_VALUE;
+      double bestDistance = Double.POSITIVE_INFINITY;
       double firstLegValue = 0.0;
       double secondLegValue = 0.0;
       Plane firstLegPlane = null;
@@ -323,7 +323,7 @@ class GeoComplexPolygon extends GeoBasePolygon {
       }
 
       assert bestDistance > 0.0 : "Best distance should not be zero unless on single plane";
-      assert bestDistance < Double.MAX_VALUE : "Couldn't find an intersection point of any kind";
+      assert bestDistance < Double.POSITIVE_INFINITY : "Couldn't find an intersection point of any kind";
       
       final DualCrossingEdgeIterator edgeIterator = new DualCrossingEdgeIterator(firstLegPlane, firstLegAbovePlane, firstLegBelowPlane, secondLegPlane, x, y, z, intersectionPoint);
       if (!firstLegTree.traverse(edgeIterator, firstLegValue)) {
@@ -390,7 +390,7 @@ class GeoComplexPolygon extends GeoBasePolygon {
 
   @Override
   protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
-    double minimumDistance = Double.MAX_VALUE;
+    double minimumDistance = Double.POSITIVE_INFINITY;
     for (final Edge shapeStartEdge : shapeStartEdges) {
       Edge shapeEdge = shapeStartEdge;
       while (true) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
index 9747eda..6600a34 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoCompositeMembershipShape.java
@@ -85,7 +85,7 @@ public class GeoCompositeMembershipShape implements GeoMembershipShape {
   public double computeOutsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
     if (isWithin(x,y,z))
       return 0.0;
-    double distance = Double.MAX_VALUE;
+    double distance = Double.POSITIVE_INFINITY;
     for (GeoMembershipShape shape : shapes) {
       final double normalDistance = shape.computeOutsideDistance(distanceStyle, x, y, z);
       if (normalDistance < distance) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java
index c18d40f..0d8f615 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConcavePolygon.java
@@ -409,7 +409,7 @@ class GeoConcavePolygon extends GeoBasePolygon {
 
   @Override
   protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
-    double minimumDistance = Double.MAX_VALUE;
+    double minimumDistance = Double.POSITIVE_INFINITY;
     for (final GeoPoint edgePoint : points) {
       final double newDist = distanceStyle.computeDistance(edgePoint, x,y,z);
       if (newDist < minimumDistance) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java
index 6f71d18..2ed516a 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoConvexPolygon.java
@@ -397,7 +397,7 @@ class GeoConvexPolygon extends GeoBasePolygon {
 
   @Override
   protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
-    double minimumDistance = Double.MAX_VALUE;
+    double minimumDistance = Double.POSITIVE_INFINITY;
     for (final GeoPoint edgePoint : points) {
       final double newDist = distanceStyle.computeDistance(edgePoint, x,y,z);
       if (newDist < minimumDistance) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
index 9328b4b..ab08579 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDegeneratePoint.java
@@ -129,7 +129,7 @@ class GeoDegeneratePoint extends GeoPoint implements GeoBBox, GeoCircle {
   public double computeDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
     if (isWithin(x,y,z))
       return 0.0;
-    return Double.MAX_VALUE;
+    return Double.POSITIVE_INFINITY;
   }
   
   @Override

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDistance.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDistance.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDistance.java
index cf8fa23..51c258a 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDistance.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoDistance.java
@@ -26,13 +26,13 @@ package org.apache.lucene.spatial3d.geom;
 public interface GeoDistance extends Membership {
   
   // The following methods compute distances from the shape to a point
-  // expected to be INSIDE the shape.  Typically a value of Double.MAX_VALUE
+  // expected to be INSIDE the shape.  Typically a value of Double.POSITIVE_INFINITY
   // is returned for points that happen to be outside the shape.
 
   /**
    * Compute this shape's <em>internal</em> "distance" to the GeoPoint.
    * Implementations should clarify how this is computed when it's non-obvious.
-   * A return value of Double.MAX_VALUE should be returned for
+   * A return value of Double.POSITIVE_INFINITY should be returned for
    * points outside of the shape.
    *
    * @param distanceStyle is the distance style.
@@ -46,7 +46,7 @@ public interface GeoDistance extends Membership {
   /**
    * Compute this shape's <em>internal</em> "distance" to the GeoPoint.
    * Implementations should clarify how this is computed when it's non-obvious.
-   * A return value of Double.MAX_VALUE should be returned for
+   * A return value of Double.POSITIVE_INFINITY should be returned for
    * points outside of the shape.
    *
    * @param x is the point's unit x coordinate (using U.S. convention).

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java
index b24d5af..0f06717 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoStandardPath.java
@@ -201,7 +201,7 @@ class GeoStandardPath extends GeoBasePath {
     double currentDistance = 0.0;
     for (PathSegment segment : segments) {
       double distance = segment.pathDistance(planetModel, distanceStyle, x,y,z);
-      if (distance != Double.MAX_VALUE)
+      if (distance != Double.POSITIVE_INFINITY)
         return currentDistance + distance;
       currentDistance += segment.fullPathDistance(distanceStyle);
     }
@@ -210,13 +210,13 @@ class GeoStandardPath extends GeoBasePath {
     currentDistance = 0.0;
     for (SegmentEndpoint endpoint : endPoints) {
       double distance = endpoint.pathDistance(distanceStyle, x, y, z);
-      if (distance != Double.MAX_VALUE)
+      if (distance != Double.POSITIVE_INFINITY)
         return currentDistance + distance;
       if (segmentIndex < segments.size())
         currentDistance += segments.get(segmentIndex++).fullPathDistance(distanceStyle);
     }
 
-    return Double.MAX_VALUE;
+    return Double.POSITIVE_INFINITY;
   }
 
   @Override
@@ -227,7 +227,7 @@ class GeoStandardPath extends GeoBasePath {
 
   @Override
   protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
-    double minDistance = Double.MAX_VALUE;
+    double minDistance = Double.POSITIVE_INFINITY;
     for (final SegmentEndpoint endpoint : endPoints) {
       final double newDistance = endpoint.outsideDistance(distanceStyle, x,y,z);
       if (newDistance < minDistance)
@@ -518,7 +518,7 @@ class GeoStandardPath extends GeoBasePath {
      */
     public double pathDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {
       if (!isWithin(x,y,z))
-        return Double.MAX_VALUE;
+        return Double.POSITIVE_INFINITY;
       return distanceStyle.computeDistance(this.point, x, y, z);
     }
 
@@ -713,7 +713,7 @@ class GeoStandardPath extends GeoBasePath {
      */
     public double pathDistance(final PlanetModel planetModel, final DistanceStyle distanceStyle, final double x, final double y, final double z) {
       if (!isWithin(x,y,z))
-        return Double.MAX_VALUE;
+        return Double.POSITIVE_INFINITY;
 
       // (1) Compute normalizedPerpPlane.  If degenerate, then return point distance from start to point.
       // Want no allocations or expensive operations!  so we do this the hard way

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java
index 8dc9be5..567d12e 100755
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/Plane.java
@@ -294,7 +294,7 @@ public class Plane extends Vector {
     if (evaluateIsZero(x,y,z)) {
       if (meetsAllBounds(x,y,z, bounds))
         return 0.0;
-      return Double.MAX_VALUE;
+      return Double.POSITIVE_INFINITY;
     }
     
     // First, compute the perpendicular plane.
@@ -307,7 +307,7 @@ public class Plane extends Vector {
     final GeoPoint[] intersectionPoints = findIntersections(planetModel, perpPlane);
     
     // For each point, compute a linear distance, and take the minimum of them
-    double minDistance = Double.MAX_VALUE;
+    double minDistance = Double.POSITIVE_INFINITY;
     
     for (final GeoPoint intersectionPoint : intersectionPoints) {
       if (meetsAllBounds(intersectionPoint, bounds)) {
@@ -347,7 +347,7 @@ public class Plane extends Vector {
     final double perpZ = z - dist * this.z;
 
     if (!meetsAllBounds(perpX, perpY, perpZ, bounds)) {
-      return Double.MAX_VALUE;
+      return Double.POSITIVE_INFINITY;
     }
     
     return Math.abs(dist);
@@ -373,7 +373,7 @@ public class Plane extends Vector {
    */
   public double normalDistanceSquared(final double x, final double y, final double z, final Membership... bounds) {
     final double normal = normalDistance(x,y,z,bounds);
-    if (normal == Double.MAX_VALUE)
+    if (normal == Double.POSITIVE_INFINITY)
       return normal;
     return normal * normal;
   }
@@ -406,7 +406,7 @@ public class Plane extends Vector {
     if (evaluateIsZero(x,y,z)) {
       if (meetsAllBounds(x,y,z, bounds))
         return 0.0;
-      return Double.MAX_VALUE;
+      return Double.POSITIVE_INFINITY;
     }
     
     // First, compute the perpendicular plane.
@@ -419,7 +419,7 @@ public class Plane extends Vector {
     final GeoPoint[] intersectionPoints = findIntersections(planetModel, perpPlane);
     
     // For each point, compute a linear distance, and take the minimum of them
-    double minDistance = Double.MAX_VALUE;
+    double minDistance = Double.POSITIVE_INFINITY;
     
     for (final GeoPoint intersectionPoint : intersectionPoints) {
       if (meetsAllBounds(intersectionPoint, bounds)) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
index ff2252c..84100cd 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoCircleTest.java
@@ -27,9 +27,9 @@ public class GeoCircleTest extends LuceneTestCase {
     GeoPoint gp;
     c = GeoCircleFactory.makeGeoCircle(PlanetModel.SPHERE, 0.0, -0.5, 0.1);
     gp = new GeoPoint(PlanetModel.SPHERE, 0.0, 0.0);
-    assertEquals(Double.MAX_VALUE, c.computeDistance(DistanceStyle.ARC,gp), 0.0);
-    assertEquals(Double.MAX_VALUE, c.computeDistance(DistanceStyle.NORMAL,gp), 0.0);
-    assertEquals(Double.MAX_VALUE, c.computeDistance(DistanceStyle.NORMAL,gp), 0.0);
+    assertEquals(Double.POSITIVE_INFINITY, c.computeDistance(DistanceStyle.ARC,gp), 0.0);
+    assertEquals(Double.POSITIVE_INFINITY, c.computeDistance(DistanceStyle.NORMAL,gp), 0.0);
+    assertEquals(Double.POSITIVE_INFINITY, c.computeDistance(DistanceStyle.NORMAL,gp), 0.0);
     gp = new GeoPoint(PlanetModel.SPHERE, 0.0, -0.5);
     assertEquals(0.0, c.computeDistance(DistanceStyle.ARC,gp), 0.000001);
     assertEquals(0.0, c.computeDistance(DistanceStyle.NORMAL,gp), 0.000001);

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a911eb85/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
index e68e3f4..96c7ea7 100755
--- a/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
+++ b/lucene/spatial3d/src/test/org/apache/lucene/spatial3d/geom/GeoPathTest.java
@@ -36,13 +36,13 @@ public class GeoPathTest {
     p.addPoint(0.0, 0.2);
     p.done();
     gp = new GeoPoint(PlanetModel.SPHERE, Math.PI * 0.5, 0.15);
-    assertEquals(Double.MAX_VALUE, p.computeDistance(DistanceStyle.ARC,gp), 0.0);
+    assertEquals(Double.POSITIVE_INFINITY, p.computeDistance(DistanceStyle.ARC,gp), 0.0);
     gp = new GeoPoint(PlanetModel.SPHERE, 0.05, 0.15);
     assertEquals(0.15 + 0.05, p.computeDistance(DistanceStyle.ARC,gp), 0.000001);
     gp = new GeoPoint(PlanetModel.SPHERE, 0.0, 0.12);
     assertEquals(0.12 + 0.0, p.computeDistance(DistanceStyle.ARC,gp), 0.000001);
     gp = new GeoPoint(PlanetModel.SPHERE, -0.15, 0.05);
-    assertEquals(Double.MAX_VALUE, p.computeDistance(DistanceStyle.ARC,gp), 0.000001);
+    assertEquals(Double.POSITIVE_INFINITY, p.computeDistance(DistanceStyle.ARC,gp), 0.000001);
     gp = new GeoPoint(PlanetModel.SPHERE, 0.0, 0.25);
     assertEquals(0.20 + 0.05, p.computeDistance(DistanceStyle.ARC,gp), 0.000001);
     gp = new GeoPoint(PlanetModel.SPHERE, 0.0, -0.05);
@@ -65,9 +65,9 @@ public class GeoPathTest {
     p.addPoint(Math.PI * 0.25, -0.5);
     p.done();
     gp = new GeoPoint(PlanetModel.SPHERE, 0.0, 0.0);
-    assertEquals(Double.MAX_VALUE, p.computeDistance(DistanceStyle.ARC,gp), 0.0);
+    assertEquals(Double.POSITIVE_INFINITY, p.computeDistance(DistanceStyle.ARC,gp), 0.0);
     gp = new GeoPoint(PlanetModel.SPHERE, -0.1, -1.0);
-    assertEquals(Double.MAX_VALUE, p.computeDistance(DistanceStyle.ARC,gp), 0.0);
+    assertEquals(Double.POSITIVE_INFINITY, p.computeDistance(DistanceStyle.ARC,gp), 0.0);
     gp = new GeoPoint(PlanetModel.SPHERE, Math.PI * 0.25 + 0.05, -0.5);
     assertEquals(Math.PI * 0.5 + 0.05, p.computeDistance(DistanceStyle.ARC,gp), 0.000001);
     gp = new GeoPoint(PlanetModel.SPHERE, -Math.PI * 0.25 - 0.05, -0.5);