Azimuth Calculator
This azimuth calculator will let you calculate the azimuth from latitude and longitude. It will tell you what is the direction you need to point your compass to, and what is the shortest distance between two points of known geographical coordinates. This article includes a short explanation of the formulas we used  they can prove themselves helpful if you plan to find the azimuth by hand.
This is not a spherical coordinates calculator  it deals with geographical coordinates only!
What is the azimuth?
By the US Army definition, the term azimuth describes the angle created by two lines: one joining your current position and the North Pole, and the one joining your current position and the distant location. Azimuth is always measured clockwise. For example, a point lying east from you would have an azimuth of 90°, but a point lying west from you  of 270°.
How to calculate the azimuth from latitude and longitude?
If you want to give a location of a point relative to your current position, you need to provide two values: the azimuth and the distance. If Earth was flat, the latter would simply by the straightline distance between two points. As Earth is a sphere (or, to be more precise, a geoid), it is the shortest travel distance between the two points ('asthecrowflies').
To calculate the distance between two points, our azimuth calculator uses the Haversine formula:
a = sin²(Δφ/2) + cos φ₁ ⋅ cos φ₂ ⋅ sin²(Δλ/2)
c = 2 ⋅ atan2 [√a, √(1−a)]
d = R ⋅ c
where:
φ₁
is the latitude of initial point (positive for N and negative for S);φ₂
is the latitude of the final point (positive for N and negative for S);λ₁
is the longitude of the initial point (positive for E and negative for W);λ₂
is the longitude of the final point (positive for E and negative for W);Δφ = φ₂  φ₁
;Δλ = λ₂  λ₁
;R
is the radius of the Earth, expressed in meters (R = 6371 km).
The azimuth can be found using the same latitudes and longitudes with the following equation:
θ = atan2 [(sin Δλ ⋅ cos φ₂), (cos φ₁ ⋅ sin φ₂ − sin φ₁ ⋅ cos φ₂ ⋅ cos Δλ)]
How to calculate the azimuth: an example
Let's assume we want to calculate the azimuth and distance required to determine the position of Rio de Janeiro respective to London. All we have to do is follow these steps:

Determine the longitude and latitude of London  our initial point. We can find that
φ₁ = 51.50°
(positive, because it lies in the northern hemisphere) andλ₁ = 0°
. 
Determine the longitude and latitude of Rio de Janeiro  our final point. We can find that
φ₂ = 22.97°
(negative, because it lies in the southern hemisphere) andλ₂ = 43.18°
(also negative, because it lies in the western hemisphere). 
Calculate
Δφ = φ₂  φ₁ = 22.97°  51.50° = 74.47°
. 
Calculate
Δλ = λ₂  λ₁ = 43.18°  0 ° = 43.18°
. 
Insert all of the data into the Haversine formula to calculate the distance:
a = sin²(Δφ/2) + cos φ₁ ⋅ cos φ₂ ⋅ sin²(Δλ/2) = sin²((74.47°)/2) + cos 51.50° ⋅ cos (22.97°) ⋅ sin²((43.18°)/2) = 0.443
c = 2 ⋅ atan2 [√a, √(1−a)] = 2 ⋅ atan2 [√0.443, √(1−0.443)] = 1.458
d = R ⋅ c = 6371 * 1.458 = 9289 km
 Calculate the azimuth from the azimuth equation:
θ = atan2 [(sin Δλ ⋅ cos φ₂), (cos φ₁ ⋅ sin φ₂ − sin φ₁ ⋅ cos φ₂ ⋅ cos Δλ)]
θ = atan2 [(sin (43.18°) ⋅ cos (22.97°)), (cos (51.50°) ⋅ sin (22.97°) − sin (51.50°) ⋅ cos (22.97°) ⋅ cos (43.18°))] = 2.455 rad
 Convert the azimuth to a positive degree value:
θ = 2.455 rad = 140.65° = 219.35°
 Congratulations! You have just calculated azimuth from latitude and longitude.