Check store distance for lending decisions
Enter the store’s position and the phone’s, or load a file of applications. See the distance in metres and which applications are beyond the trigger.
Distance
The phone was 9,029 m from the store, beyond the trigger of 1,000 m. That is a reason to look at the application. Distance alone does not show fraud.
Show working
φ1 = 30.0614° × π ÷ 180 = 0.524670 φ2 = 30.1426° × π ÷ 180 = 0.526088 Δφ = φ2 − φ1 = 0.001417 Δλ = (31.2197° − 31.2197°) × π ÷ 180 = 0.000000 a = sin²(Δφ ÷ 2) + cos φ1 · cos φ2 · sin²(Δλ ÷ 2) = 5.021191e-7 Distance = 2 · R · atan2(√a, √(1 − a)) = 2 · 6,371,000 · 0.000709 = 9,029 m R = Earth’s radius = 6,371,000 m
Applications file
1,778 applications have a distance, and 22 rows were left out because a position was missing or not valid.
Your files are read in this browser and never uploaded. Only counts are sent if you request the result by email.
Optional stores file
If applications have a store ID instead of the store’s position, a file of stores with their ID, latitude and longitude fills it in.
These are 1,800 generated demo applications from 12 stores in Cairo, with one store where a third of the applications come from far away.
Applications beyond trigger
149 of 1,778 applications came from a phone more than 1,000 m from the store. The stores table shows where they cluster.
Applications by distance band
Each bar shows the applications in one distance band, and red bars are beyond the trigger.
Store share beyond trigger
| Rank | Store | Apps | Beyond trigger | Share | Median distance |
|---|---|---|---|---|---|
| 1 | GIZ-H12 | 146 | 48 | 32.9% | 64 |
| 2 | CAI-N02 | 149 | 15 | 10.1% | 47 |
| 3 | CAI-D03 | 148 | 12 | 8.1% | 49 |
| 4 | CAI-A06 | 147 | 11 | 7.5% | 52 |
| 5 | CAI-Z14 | 149 | 11 | 7.4% | 52 |
| 6 | CAI-S08 | 149 | 10 | 6.7% | 54 |
| 7 | GIZ-O01 | 149 | 9 | 6.0% | 41 |
| 8 | CAI-M07 | 150 | 8 | 5.3% | 45 |
| 9 | CAI-C04 | 149 | 7 | 4.7% | 49 |
| 10 | CAI-D11 | 147 | 6 | 4.1% | 44 |
2 more stores are in the download.
Farthest applications
| Application | Store | Distance, m | Beyond trigger |
|---|---|---|---|
| APP-6188 | GIZ-O01 | 36,641 | Yes |
| APP-5799 | GIZ-M05 | 36,134 | Yes |
| APP-6634 | GIZ-H12 | 34,956 | Yes |
| APP-5326 | CAI-M07 | 34,834 | Yes |
| APP-6556 | GIZ-H12 | 33,496 | Yes |
| APP-5978 | CAI-D11 | 32,819 | Yes |
| APP-6660 | CAI-A06 | 31,466 | Yes |
| APP-6689 | CAI-A06 | 30,648 | Yes |
| APP-6597 | GIZ-H12 | 30,548 | Yes |
| APP-5612 | CAI-N02 | 29,834 | Yes |
| APP-6519 | GIZ-H12 | 29,134 | Yes |
| APP-5315 | CAI-M07 | 27,828 | Yes |
| APP-5166 | CAI-D03 | 27,668 | Yes |
| APP-6641 | GIZ-H12 | 25,983 | Yes |
| APP-6134 | GIZ-O01 | 25,173 | Yes |
| APP-6625 | GIZ-H12 | 24,068 | Yes |
| APP-5144 | CAI-Z14 | 23,863 | Yes |
| APP-5654 | CAI-N02 | 23,855 | Yes |
| APP-6401 | CAI-S08 | 22,818 | Yes |
| APP-5212 | CAI-D03 | 21,889 | Yes |
| APP-5355 | CAI-M07 | 21,455 | Yes |
| APP-6511 | GIZ-H12 | 21,217 | Yes |
| APP-6725 | CAI-A06 | 20,932 | Yes |
| APP-5297 | CAI-D03 | 19,897 | Yes |
| APP-6520 | GIZ-H12 | 19,806 | Yes |
1,753 more are in the download.
Get the result by email
Run the same distance check on every application at decision time, using the coordinates it already carries and a policy written in metres. Start free
Show the formula
φ = Latitude in radians λ = Longitude in radians R = Earth’s radius = 6,371,000 m a = sin²(Δφ ÷ 2) + cos φ1 · cos φ2 · sin²(Δλ ÷ 2) Distance = 2 · R · atan2(√a, √(1 − a)) Beyond trigger = Distance > Trigger distance
The distance is the shortest path along a sphere’s surface, not a road distance, and is only as accurate as the two positions, since a phone or photo can report a wrong one. A row with a missing or out-of-range position, or a position exactly 0, 0, is left out rather than read as a place.
Distance between GPS coordinates
The haversine formula works out the distance between two latitude and longitude positions along the surface of a sphere. Enter the store’s position and the phone’s, and the tool shows the distance in metres and kilometres.
The distance can help you see whether a customer’s phone was near the store when they applied. Set a trigger distance to review applications beyond it, then use the same check across a file of applications.
Distance questions
How do I calculate the distance between two GPS coordinates?
The haversine formula uses the latitude and longitude of both positions to calculate the distance along a sphere’s surface. This tool shows the result in metres and kilometres.
What is the haversine formula?
It is a formula for calculating the distance between two positions from their latitude and longitude. The tool shows the working with the numbers you entered.
How far was a customer from the store when they applied?
Enter the store’s position and the phone’s position to see the distance between them. The result is along the surface of a sphere and depends on the accuracy of both positions.
What distance should I use for a store location check?
Set a trigger distance in metres for the check. An application beyond it is a reason to review, and the distance alone does not establish fraud.
How does haversine compare with the spherical law of cosines?
This tool uses haversine to work out the distance. The related article sets that formula beside the spherical law of cosines.