If you have arrived here, there is no need to explain it now, but I will explain it just in case. Latitude and longitude are a coordinate system that expresses our position on the earth. Latitude is the angle from the equator, and longitude is the angle from the meridian line passing through the site of Greenwich Observatory in England. Some people may find it easier to understand if they remember that longitude is in the x-direction and latitude is in the y-direction. Using these values, we can calculate the distance between two points on the earth.
Algorithm for finding a straight line distance from latitude and longitude
Several algorithms exist to determine linear distances from latitude and longitude. These methods can be used depending on the shape of the earth and accuracy requirements. This article describes three typical types.
Hybeny’s Distance Formula
It is obtained from the commonly used Hybeny’s distance formula.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The GoogleMapAPI geometory.computeDistanceBetween uses this formula. In reality, the earth is not an exact sphere but an ellipsoid, so there is an error, but the formula is simple and can be calculated quickly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
コメント