Distance & Bearings
Home Up Convert Degrees Distance & Bearings


Calculate distance and bearing between two Latitude/Longitude points

Enter the co-ordinates into the text boxes to try it out. It accepts a variety of formats:

  • deg-min-sec suffixed with N/S/E/W (e.g. 40°44′55″N, 73 59 11W), or
  • signed decimal degrees without compass direction, where negative indicates west/south (e.g. 40.7486, -73.9864):

Lat 1: Long 1:

Lat 2: Long 2:

And you can see it on a map (thanks to the nice guys at Google Maps)


Destination point given distance and bearing from start point

Given a start point, initial bearing, and distance, this will calculate the destination point and final bearing traveling along a (shortest distance) great circle arc.

Start Lat: Start Long:
Bearing (deg): Distance (km):

  


Lat 1: Long 1:

Lat 2: Long 2:


Start Lat: Start Long:
Bearing (deg): Distance (km):

    (jason)


Convert between degrees-minutes-seconds & decimal degrees

Latitude   Longitude   1° ≈ 111 km (110.57 eq’l — 111.70 polar)
    1′ ≈ 1.85 km (= 1 nm) 0.001° ≈ 111 m
    1″ ≈ 30.9 m 0.00001° ≈ 1 m

*Since the earth is not quite a sphere, there are small errors in using spherical geometry; the earth is actually roughly ellipsoidal (or more precisely, oblate spheroidal) with a radius varying between about 6,378km (equatorial) and 6,357km (polar), and local radius of curvature varying from 6,336km (equatorial meridian) to 6,399km (polar). This means that errors from assuming spherical geometry might be up to 0.55% crossing the equator, though generally below 0.3%, depending on latitude and direction of travel. An accuracy of better than 3m in 1km is good enough for me, but if you want greater accuracy, you could refine the result by using the local radius of curvature, as explained in the US Census Bureau GIS FAQ.


  • Notes: trig functions take arguments in radians, so latitude, longitude, and bearings in degrees (either decimal or degrees/minutes/seconds) need to be converted to radians, rad = π.deg/180. When converting radians back to degrees (deg = 180.rad/π), West is negative if using signed decimal degrees. For bearings, values in the range -π to +π (-180° to +180°) need to be converted to 0 to +2π (0°–360°); this can be done by (brng+2.π)%2.π where % is the modulo operator. View page source to see JavaScript functions to handle these conversions.
  • The atan2() function widely used here takes two arguments, atan2(y, x), and computes the arc tangent of the ratio y/x. It is more flexible than atan(y/x), since it handles x=0, and it also returns values in all 4 quadrants -π to +π (the atan function returns values in the range -π/2 to +π/2).
  • If you implement any formula involving atan2 in Microsoft Excel, you will need to reverse the arguments, as Excel has them the opposite way around from JavaScript – conventional order is atan2(y, x), but Excel uses atan2(x, y)
  • For miles, divide km by 1.609344
  • For nautical miles, divide km by 1.852


(c) 1999- jAssing Consulting -- Contact webmaster@jassing.com for problems