18 lines
532 B
Plaintext
18 lines
532 B
Plaintext
100 cls
|
|
110 pi = arctan(1)*4 : rem define pi = 3.1415...
|
|
120 deg2rad = pi/180 : rem define grados a radianes 0.01745..
|
|
130 lat1 = 36.12
|
|
140 long1 = -86.67
|
|
150 lat2 = 33.94
|
|
160 long2 = -118.4
|
|
170 radio = 6372.8
|
|
180 print " Distancia de Haversine entre BNA y LAX = ";
|
|
190 d_long = deg2rad*(long1-long2)
|
|
200 theta1 = deg2rad*(lat1)
|
|
210 theta2 = deg2rad*(lat2)
|
|
220 dx = cos(d_long)*cos(theta1)-cos(theta2)
|
|
230 dy = sin(d_long)*cos(theta1)
|
|
240 dz = sin(theta1)-sin(theta2)
|
|
250 print (asin(sqr(dx*dx+dy*dy+dz*dz)/2)*radio*2);"km"
|
|
260 end
|