21 lines
663 B
Plaintext
21 lines
663 B
Plaintext
D2R = atn(1)/45
|
|
diam = 2 * 6372.8
|
|
Lg1m2 = ((-86.67)-(-118.4)) * D2R
|
|
Lt1 = 36.12 * D2R ' degrees to rad
|
|
Lt2 = 33.94 * D2R
|
|
dz = sin(Lt1) - sin(Lt2)
|
|
dx = cos(Lg1m2) * cos(Lt1) - cos(Lt2)
|
|
dy = sin(Lg1m2) * cos(Lt1)
|
|
hDist = asn((dx^2 + dy^2 + dz^2)^0.5 /2) * diam
|
|
print "Haversine distance: ";using("####.#############",hDist);" km."
|
|
|
|
'Tips: ( 36 deg 7 min 12 sec ) = print 36+(7/60)+(12/3600). Produces: 36.12 deg.
|
|
'
|
|
' http://maps.google.com
|
|
' Search 36.12,-86.67
|
|
' Earth.
|
|
' Center the pin, zoom airport.
|
|
' Directions (destination).
|
|
' 36.12.-86.66999
|
|
' Distance is 35.37 inches.
|