-
Notifications
You must be signed in to change notification settings - Fork 124
Fix Haversine formula in position class (Datatypes.py) #110
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@diegogarromolina thanks for the PR. The CI failure you're seeing is related to our python 3.7 Travis configuration and not your PR.
Could you add a test to the test suite that confirms that this is producing the desired results?
|
Sorry, but the documentation is not clear at position class. Long and Lat in the constructor are floats in degrees I guess, but to compute |
|
The methods of the datatypes.position class are dead code, really. They have never been used for anything. I would be inclined to delete the getdistance() and getdirection() methods, rather than fix them. Keeping them around just creates a maintenance burden - it doesn't benefit users of this module. |
|
Like I said above, I develop the correct computes in Dart, but you got a good point, they have never been used for anything. If you delete them, then I don't make a PR. Thanks. You can follow the repo in Dart here: You inspired this project :) |
The correct formula has sin²(anlge).
|
I rebased this just to see what CI / codecov says. I am inclined to take this PR and then cull the unused API with a subsequent PR. We likely don't have any contract with what our library's public API is and we are still at version 0.x :) |
Codecov Report
@@ Coverage Diff @@
## master #110 +/- ##
=======================================
Coverage 87.41% 87.41%
=======================================
Files 4 4
Lines 1049 1049
=======================================
Hits 917 917
Misses 132 132
Continue to review full report at Codecov.
|
The correct formula has sin²(angle).