fk
This commit is contained in:
@@ -210,6 +210,9 @@ func EarthDistance(lng1, lat1, lng2, lat2 float64) float64 {
|
||||
lng2 = lng2 * rad
|
||||
theta := lng2 - lng1
|
||||
dist := math.Acos(math.Sin(lat1)*math.Sin(lat2) + math.Cos(lat1)*math.Cos(lat2)*math.Cos(theta))
|
||||
if dist < 0 {
|
||||
dist = 0
|
||||
}
|
||||
return dist * radius
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user