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/12/11 09:23:37 UTC

lucene-solr:branch_7x: LUCENE-8089: Add PlanetModel method that returns true if planetmodel is a sphere.

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_7x 6d74bbe00 -> afced0c5d


LUCENE-8089: Add PlanetModel method that returns true if planetmodel is a sphere.


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

Branch: refs/heads/branch_7x
Commit: afced0c5d7fad7ec963aff13ee8ea65104de3ba4
Parents: 6d74bbe
Author: Karl Wright <Da...@gmail.com>
Authored: Mon Dec 11 04:21:52 2017 -0500
Committer: Karl Wright <Da...@gmail.com>
Committed: Mon Dec 11 04:23:32 2017 -0500

----------------------------------------------------------------------
 .../java/org/apache/lucene/spatial3d/geom/PlanetModel.java    | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/afced0c5/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
----------------------------------------------------------------------
diff --git a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
index 2aabfc1..55b730d 100644
--- a/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
+++ b/lucene/spatial3d/src/java/org/apache/lucene/spatial3d/geom/PlanetModel.java
@@ -122,6 +122,13 @@ public class PlanetModel implements SerializableObject {
     SerializableObject.writeDouble(outputStream, c);
   }
   
+  /** Does this planet model describe a sphere?
+   *@return true if so.
+   */
+  public boolean isSphere() {
+    return this.ab == this.c;
+  }
+  
   /** Find the minimum magnitude of all points on the ellipsoid.
    * @return the minimum magnitude for the planet.
    */