LUCENE-7849: GeoWideLongitudeSlice can fail to construct

This commit is contained in:
Karl Wright 2017-05-24 09:46:15 -04:00
parent 851ab0ad34
commit fed7343d2e
1 changed files with 7 additions and 1 deletions

View File

@ -75,7 +75,13 @@ class GeoWideLongitudeSlice extends GeoBaseBBox {
while (leftLon > rightLon) {
rightLon += Math.PI * 2.0;
}
final double middleLon = (leftLon + rightLon) * 0.5;
double middleLon = (leftLon + rightLon) * 0.5;
while (middleLon > Math.PI) {
middleLon -= Math.PI * 2.0;
}
while (middleLon < -Math.PI) {
middleLon += Math.PI * 2.0;
}
this.centerPoint = new GeoPoint(planetModel, 0.0, middleLon);
this.leftPlane = new SidedPlane(centerPoint, cosLeftLon, sinLeftLon);