14 lines
527 B
Text
14 lines
527 B
Text
include c:\cxpl\codes; \intrinsic 'code' declarations
|
|
|
|
func real Haversine(Ang);
|
|
real Ang;
|
|
return (1.0-Cos(Ang)) / 2.0;
|
|
|
|
func real Dist(Lat1, Lat2, Lon1, Lon2); \Great circle distance
|
|
real Lat1, Lat2, Lon1, Lon2;
|
|
def R = 6372.8; \average radius of Earth (km)
|
|
return 2.0*R * ASin( sqrt( Haversine(Lat2-Lat1) +
|
|
Cos(Lat1)*Cos(Lat2)*Haversine(Lon2-Lon1) ));
|
|
|
|
def D2R = 3.141592654/180.0; \degrees to radians
|
|
RlOut(0, Dist(36.12*D2R, 33.94*D2R, -86.67*D2R, -118.40*D2R ));
|