Rad/Derece =2*π/360
Rad=Derece*(π/180)
π/180=1/ 57.2957795130823
Function HaversineHsp(lat1 As Double, lon1 As Double, lat2 As Double, lon2 As Double) As Double
Dim R As Double
R = 6371 ' Dünya yarıçapı km cinsinden
Dim dLat As Double, dLon As Double
dLat = (lat2 - lat1) / 57.2957795130823
dLon = (lon2 - lon1) / 57.2957795130823
Dim a As Double, c As Double
a = Sin(dLat / 2) ^ 2 + Cos((lat1) / 57.2957795130823) * Cos((lat2) / 57.2957795130823) * Sin(dLon / 2) ^ 2
c = 2 * Atn(Sqr(a) / Sqr(1 - a))
HaversineHsp = R * c
End Function