The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




Thread: Formula help
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #7 (permalink)  
Old 03-28-2008
bobo bobo is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 148
Question

This formula will yield the distance between 2 coordinates.
Can this be done in UNIX?? Anyone knows how???

Lat1 = 43.335
Lon1 = -70.9884

Lat2 = 43.4829
Lon2 = -71.246

distance =3444*ACOS(COS(RADIANS(90-(Lat1)))*COS(RADIANS(90-(Lat2)))+SIN(RADIANS(90-(Lat1)))*SIN(RADIANS(90-(Lat2)))*COS(RADIANS((Lon1-Lon2))))

distance = 14.3376283 miles