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

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
• 4
• 3
• 3
• +2
2 Solutions

Commented:
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

Author Commented:
How do I do a (lon1-lon 2) with Degrees Decinal Minutes?

IElite
0

Commented:
what format are they in?
0

Commented:
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

3950 miles (6356.9 kilometres). Polar
3963 miles (6378.5 kilometres). Equitorial

0

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

Author 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

Commented:
Do you want to do it on the WGS84 ellipsoid, or is the spherical approximation good enough for you?
0

Author Commented:
0

Commented:
You need to google for the Vincenty direct and inverse algorithms.  They do exactly what you want, but they're kind of complex.

0

Retired 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

Commented:
I believe ozo's answer is for the spherical approximation, not WGS84.
0

Commented:
You are correct.
0

Featured Post

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