• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1601
  • Last Modified:

Distance & Bearing between two waypoints?

Distance & Bearing between two waypoints?

Given a two Waypoints - for Example:  N 44° 48.169   W 073° 25.625
                                                        N 44° 49.628   W 073° 26.610



How would you determine the  bearing and distance between two waypoints?

Formula and answer to the waypoints given

thanks!

IElite
0
IElite
Asked:
IElite
  • 4
  • 3
  • 3
  • +2
2 Solutions
 
ozoCommented:
bearing = asin(
sin(lon1-lon2)*cos(lat2)
/
sin(acos(sin(lat2)*sin(lat1)+cos(lat1)*cos(lat2)*cos(lon2-lon1)))
)

distance = acos(sin(lat2)*sin(lat1)+cos(lat1)*cos(lat2)*cos(lon2-lon1))
0
 
IEliteAuthor Commented:
How do I do a (lon1-lon 2) with Degrees Decinal Minutes?

IElite
0
 
GwynforWebCommented:
what format are they in?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
GwynforWebCommented:
The above formula gives the radial distance, there is a difference between the radial distance and the distance in miles or kilometers, you must multiple the radial distance by the earths radius to get the physical distance.

http://www.circuitcellar.com/library/print/1000/Stefan123/5.htm

Earths radius:
3950 miles (6356.9 kilometres). Polar
3963 miles (6378.5 kilometres). Equitorial

0
 
GwynforWebCommented:
you must also convert the lon lat to radians first, ie multiply degrees by 2*Pi/360
0
 
IEliteAuthor Commented:
073° 25.625

Im not getting it!  I do i convert these numbers so I can do an operation (Example: lon1-lon2)


   073° 25.625
-  073° 26.610


I need to be able to do this from with in programming source code.....

IELite


0
 
NovaDenizenCommented:
Do you want to do it on the WGS84 ellipsoid, or is the spherical approximation good enough for you?
0
 
IEliteAuthor Commented:
The WGS-84 (NAD-83) datum
0
 
NovaDenizenCommented:
You need to google for the Vincenty direct and inverse algorithms.  They do exactly what you want, but they're kind of complex.

http://www.google.com/search?q=vincenty+direct+inverse&sourceid=mozilla-search&start=0&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official
0
 
dhsindy SparrowRetired considering supplemental income.Commented:
Here is an on-line calculator you can use to check your calculation (look near the bottom for a couple of links:

http://pollux.nss.nima.mil/calc/calc_options.html#Distance%20Calculator
0
 
NovaDenizenCommented:
I believe ozo's answer is for the spherical approximation, not WGS84.
0
 
GwynforWebCommented:
You are correct.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now