![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Abacus Formula Compiler 1.0.1 (Default branch) | iBot | Software Releases - RSS News | 0 | 03-09-2008 06:20 AM |
| formula to get the swap space on a machine | melanie_pfefer | SUN Solaris | 1 | 03-03-2008 03:15 PM |
| Help with formula in a script | scottzx7rr | Shell Programming and Scripting | 3 | 08-15-2007 04:19 AM |
| Quadratic Formula Program | zeek | UNIX for Advanced & Expert Users | 2 | 02-22-2002 11:32 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
The formula below will calculate a distance in miles between 2 points in excel. Can some put it to work in unix?
Lat = 43.335 Lon1 = -70.9884 Lat2 = 43.4829 Lon2 = -71.246 distance =3444*ACOS(COS(RADIANS(90-(Lat)))*COS(RADIANS(90-(Lat2)))+SIN(RADIANS(90-(Lat1)))*SIN(RADIANS(90-(Lat2)))*COS(RADIANS((Lon1-Lon2)))) distance = 14.3376283 miles |
|
||||
|
HOME has a utility called gcb which you can download and install. It's probably more exact than your Excel formula, although the web page design (or lack of same) hints that usability might be nearly as bad as Excel.
If you're on Debian or Ubuntu, aptitude install gcb |
|
||||
|
A quick detour via Google seems to suggest that the constant in the Excel formula is wrong, or at least debatable, it should be something like 3963 for miles, or 6378.8 for kilometers. Another source has 3959.98 for miles or 6372.797 for kilometers. Apparently, it (also) depends on how far from the equator you are.
See also Unit 014 - Latitude and Longitude |
|
||||
|
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 |
![]() |
| Bookmarks |
| Tags |
| linux, ubuntu, unix download |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|