Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ypankaj007/haversine-formula
Haversine formula to find distance between two points on a sphere
https://github.com/ypankaj007/haversine-formula
distance go haversine-formula sphere
Last synced: 2 days ago
JSON representation
Haversine formula to find distance between two points on a sphere
- Host: GitHub
- URL: https://github.com/ypankaj007/haversine-formula
- Owner: ypankaj007
- Created: 2019-08-07T09:26:16.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-30T06:39:45.000Z (about 5 years ago)
- Last Synced: 2024-06-19T14:55:30.766Z (7 months ago)
- Topics: distance, go, haversine-formula, sphere
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Haversine Formula
Haversine formula calculates the distance between two points by using latitude and logitude on a sphere. There are lot of applications using navigation system and haversine formula are playing big role to calcutate the shortest distance between locations.
# Formula
Suppose we have two ponits p1 and p2. let radius of p1 is (φ1, λ1) and p2 is (φ2, λ2).
So difference between p1 and p2, by using haversine formula, is
```
a = sin²(Δφ/2) + cos φ1 ⋅ cos φ2 ⋅ sin²(Δλ/2)
c = 2 ⋅ atan2( √a, √(1−a) )
d = R ⋅ c
```
where Δφ = φ2 - φ1, Δλ = λ2 - λ1 and R is the Earth radius (63,71,000 m)License
----MIT
**Free Software, Hell Yeah!**