Skip to content

Commit 4f22cab

Browse files
committed
Fix #292 by proper calculation of the extreme latitude
1 parent 68b29a7 commit 4f22cab

File tree

1 file changed

+1
-1
lines changed
  • rtree2d-core/shared/src/main/scala/com/github/plokhotnyuk/rtree2d/core

1 file changed

+1
-1
lines changed

rtree2d-core/shared/src/main/scala/com/github/plokhotnyuk/rtree2d/core/Geometry.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ trait Spherical {
212212
if (normalize(minLon - lon) <= normalize(lon - maxLon)) minLon
213213
else maxLon
214214
val latCosPerLonDeltaCos = latCos * cos((closestLon - lon) * radPerDegree)
215-
val extremumLat = atan(latSin / latCosPerLonDeltaCos)
215+
val extremumLat = atan(latSin / latCosPerLonDeltaCos) * degreePerRad
216216
val normalizedDistanceCos = max(
217217
latSin * minLatSin + latCosPerLonDeltaCos * minLatCos,
218218
latSin * maxLatSin + latCosPerLonDeltaCos * maxLatCos)

0 commit comments

Comments
 (0)