You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by kw...@apache.org on 2017/09/25 07:06:57 UTC

lucene-solr:master: LUCENE-7970: Correct a misinterpretation of bearing direction

Repository: lucene-solr
Updated Branches:
  refs/heads/master a839700ee -> f8f19562e


LUCENE-7970: Correct a misinterpretation of bearing direction


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

Branch: refs/heads/master
Commit: f8f19562ee359cbf1a7711d13754e3a1c6c61920
Parents: a839700
Author: Karl Wright <Da...@gmail.com>
Authored: Mon Sep 25 03:06:49 2017 -0400
Committer: Karl Wright <Da...@gmail.com>
Committed: Mon Sep 25 03:06:49 2017 -0400

----------------------------------------------------------------------
 .../lucene/spatial3d/geom/GeoExactCircle.java       | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/f8f19562/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
index 7d96cfa..b6ae081 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/GeoExactCircle.java
@@ -124,21 +124,21 @@ class GeoExactCircle extends GeoBaseCircle {
       // We construct approximation planes until we have a low enough error estimate
       final List<ApproximationSlice> slices = new ArrayList<>(100);
       // Construct four cardinal points, and then we'll build the first two planes
-      final GeoPoint northPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, Math.PI * 0.5);
-      final GeoPoint southPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, Math.PI * 1.5);
-      final GeoPoint eastPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, 0.0);
-      final GeoPoint westPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, Math.PI);
+      final GeoPoint northPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, 0.0);
+      final GeoPoint southPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, Math.PI);
+      final GeoPoint eastPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, Math.PI * 0.5);
+      final GeoPoint westPoint = planetModel.surfacePointOnBearing(center, cutoffAngle, Math.PI * 1.5);
       
       this.edgePoints = new GeoPoint[]{northPoint};
       
       if (planetModel.c > planetModel.ab) {
         // z can be greater than x or y, so ellipse is longer in height than width
-        slices.add(new ApproximationSlice(center, eastPoint, 0.0, westPoint, Math.PI, northPoint, Math.PI * 0.5));
-        slices.add(new ApproximationSlice(center, westPoint, Math.PI, eastPoint, 0.0, southPoint, Math.PI * 1.5));
+        slices.add(new ApproximationSlice(center, eastPoint, Math.PI * 0.5, westPoint, Math.PI * -0.5, northPoint, 0.0));
+        slices.add(new ApproximationSlice(center, westPoint, Math.PI * 1.5, eastPoint, Math.PI * 0.5, southPoint, Math.PI));
       } else {
         // z will be less than x or y, so ellipse is shorter than it is tall
-        slices.add(new ApproximationSlice(center, northPoint, Math.PI * 0.5, southPoint, Math.PI * 1.5, eastPoint, 0.0));
-        slices.add(new ApproximationSlice(center, southPoint, Math.PI * 1.5, northPoint, Math.PI * 0.5, westPoint, Math.PI));
+        slices.add(new ApproximationSlice(center, northPoint, Math.PI * 2.0, southPoint, Math.PI, eastPoint, Math.PI * 0.5));
+        slices.add(new ApproximationSlice(center, southPoint, Math.PI, northPoint, 0.0, westPoint, Math.PI * 1.5));
       }
       
       // Now, iterate over slices until we have converted all of them into safe SidedPlanes.