-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement Great-circle distance #7
Comments
I believe this is implemented already under the name Haversine distance. https://github.com/DivineOmega/php-distance/blob/master/src/Types/Haversine.php Please feel free to double check this though. |
@DivineOmega, thank you for your reply. After checking these two distance formulas, they're different and the According to this wiki reference, it has two different formulas in the different condition. The first formula is as follows: And the distance is: ( On computer systems with low floating-point precision, the spherical law of cosines formula can have large rounding errors if the distance is small. The haversine formula is numerically better-conditioned for small distances: And the second formula is same as I think we don't have to implement the first formula I mention because this formula will have the rounding errors on the computing system, right? |
Interesting. This is not something I have considered before. The wiki also states that:
|
@DivineOmega, thank you for your reply. I think we can get the two points are as follows:
What do you think about that? Thanks. |
@DivineOmega, any thought about this :)? |
Please refer this: https://en.wikipedia.org/wiki/Great-circle_distance
The text was updated successfully, but these errors were encountered: