If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Formula for straight line distance between two waypoints

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-27-11, 13:33
scrtchmstj scrtchmstj is offline
Registered User
 
Join Date: Jan 2009
Location: Louisiana, United States
Posts: 138
Formula for straight line distance between two waypoints

Here's an Excel formula for calculating the straightline distance between two waypoints, given the curvature of the earth. I put this together originally to try to determine which of our distribution centers should service which zip codes. It wasn't much use for that application but I have found many other uses for it. There are plenty of sites with zip code lists including lat and long if that is what you want to do. Latitude and longitude values must be in degrees (which is the way you'll usually see them). Just thought it might benefit others. Joshua

Quote:
=IF(SIN(RADIANS(From Latitude))*SIN(RADIANS(To Latitude))+COS(RADIANS(From Latitude))*COS(RADIANS(To Latitude))*COS(RADIANS(From Longitude)-RADIANS(To Longitude))>1,3963.1*ACOS(1),3963.1*ACOS(SIN(RADIA NS(From Latitude))*SIN(RADIANS(To Latitude))+COS(RADIANS(From Latitude))*COS(RADIANS(To Latitude))*COS(RADIANS(From Longitude)-RADIANS(To Longitude))))
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On