13 lines
459 B
Text
13 lines
459 B
Text
10 Point 7 'Sets decimal display to 32 places (0+.1^56)
|
|
20 Rf=#pi/180 'Degree -> Radian Conversion
|
|
100 ?Using(,7),.DxH(36+7.2/60,-(86+40.2/60),33+56.4/60,-(118+24/60));" km"
|
|
999 End
|
|
1000 '*** Haversine Distance Function ***
|
|
1010 .DxH(Lat_s,Long_s,Lat_f,Long_f)
|
|
1020 L_s=Lat_s*rf:L_f=Lat_f*rf:LD=L_f-L_s:MD=(Long_f-Long_s)*rf
|
|
1030 Return(12745.6*asin( (sin(.5*LD)^2+cos(L_s)*cos(L_f)*sin(.5*MD)^2)^.5))
|
|
'' ''
|
|
|
|
Run
|
|
2887.2599506 km
|
|
OK
|