-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrong DistanceEstimateInMeter if coords are close but different hemisphere #279
Comments
Hey, thanks for pointing this out. I made a quick unit test using your example code integrated and I still get what seems to be anomalous results:
|
@xivk , I tried an implementation from stack overflow and still I don't get 223 or less...
But I do get |
Addressed in #302 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If (lon1 = 179, lat1 = 0) and (lon2=-179, lat2=0)
you will get distance about 40000 km. but must be 222 km.
My fix below:
var lat1Rad = (lat1 / 180d) * System.Math.PI;
var lon1Rad = (lon1 / 180d) * System.Math.PI;
var lat2Rad = (lat2 / 180d) * System.Math.PI;
var lon2Rad = (lon2 / 180d) * System.Math.PI;
The text was updated successfully, but these errors were encountered: