| 123456789101112131415161718192021222324252627 |
- #http://instantglobe.com/CRANES/GeoCoordTool.html
- import math
- R = 6371
- PI = 3.141592
- tc1 = 0
- lat2 = 44.909916*(PI/180)
- lon2 = 4.847728*(PI/180)
- lat1 = 45.178890*(PI/180)
- lon1 = 5.708217*(PI/180)
- drad = math.acos(math.sin(lat1)*math.sin(lat2) + math.cos(lat1)*math.cos(lat2)*math.cos(-lon1+lon2))
- dist = drad * R
- if math.sin(-lon2+lon1)<0 :
- tc1=math.acos((math.sin(lat2)-math.sin(lat1)*math.cos(drad))/(math.sin(drad)*math.cos(lat1)))
- else :
- tc1=2*3.1415-math.acos((math.sin(lat2)-math.sin(lat1)*math.cos(drad))/(math.sin(drad)*math.cos(lat1)))
- print(tc1*(180/PI),dist)
- #dist 73.9248
- #angle 65.83°deg
|