sibartlett / Geo

A geospatial library for .NET
https://www.nuget.org/packages/Geo/
GNU Lesser General Public License v3.0
179 stars 39 forks source link

Calculating orthodromic line fails for certain points. #7

Closed danielcweber closed 10 years ago

danielcweber commented 10 years ago

Hi,

using a SpheroidCalculator with Spheroid.Wgs84, calculating the orthodromic line for

lat1, lon1 = 30, 176, lat2, lon2 = -30, -3.5

fails with an ArithmeticException, while calculating it for

lat1, lon1 = 30, 175, lat2, lon2 = -30, -3.5

runs just fine. I have some unit tests for my app that use random data and fail occasionally. It seems that lat1 = -lat2 seems to be a neccessary but not sufficient condition for failure.

sibartlett commented 10 years ago

The algorithm wasn't converging nicely, but I've now applied a fix for this. I've also pushed the fix to NuGet.

Thank you for reporting this issue!