Fix Haversine formula in position class (Datatypes.py)#110
Fix Haversine formula in position class (Datatypes.py)#110akrherz merged 1 commit intopython-metar:masterfrom
Conversation
phobson
left a comment
There was a problem hiding this comment.
@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).