Azimuth Calculator

Created by Bogna Szyk
Reviewed by Steven Wooding
Last updated: May 12, 2022

This azimuth calculator will let you calculate the azimuth from the latitude and longitude of two points. It will tell you which 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 – 270°.

The azimuth is used when indicating a position in the sky too: it marks the horizontal direction. The altitude indicates the vertical direction varying from 0 (the horizon) to 90° (the zenith).

The point opposite to the zenith is called the nadir. Your antipode lies at the nadir: calculate it with our antipode calculator!

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 were flat, the latter would simply be the straight-line distance between two points. As Earth is a sphere (or, more precisely, a geoid), it is the shortest travel distance between the two points ('as-the-crow-flies').

To calculate the distance dd between two points, our azimuth calculator uses the Haversine formula:

a=sin2(Δϕ2) +cosϕ1cosϕ2sin2(Δλ2)\footnotesize \begin{align*} a = &\sin^2\left(\frac{\Delta\phi}{2}\right)\ +\\ &\qquad\quad\cos \phi_1 \cos\phi_2 \sin^2\left(\frac{\Delta\lambda}{2}\right)\\ \end{align*}
d=2R arctan2(a,1a)\footnotesize \begin{align*} d &= 2R\ \text{arctan}2(\sqrt{a}, \sqrt{1-a}) \end{align*}


  • ϕ1\phi_1 – Latitude of the initial point (positive for N and negative for S);
  • ϕ2\phi_2 – Latitude of the final point (positive for N and negative for S);
  • λ1\lambda_1 – Longitude of the initial point (positive for E and negative for W);
  • λ2\lambda_2 – Longitude of the final point (positive for E and negative for W);
  • Δϕ=ϕ2ϕ1\Delta\phi = \phi_2 - \phi_1;
  • Δλ=λ2λ1\Delta\lambda = \lambda_2 - \lambda_1;
  • aa is an intermediate step; and
  • RR is the radius of the Earth, expressed in meters (R=6371 kmR = 6371\ \text{km}).

Input latitudes and longitudes in the decimal degrees notation.

You can find the azimuth θ\theta using the same latitudes and longitudes with the following equation:

θ= arctan2(sinΔλcosϕ2,cosϕ1sinϕ2sinϕ1cosϕ2cosΔλ)\footnotesize \! \begin{align*} \theta =\ &\text{arctan2}(\sin\Delta\lambda\cos\phi_2,\\ &\!\!\cos\phi_1\sin\phi2 - \sin\phi_1\cos\phi_2\cos\Delta\lambda) \end{align*}

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:

  1. Determine the longitude and latitude of London – our initial point. We can find that ϕ1=51.50°\phi_1 = 51.50\degree (positive because it lies in the northern hemisphere) and λ1=0°\lambda_1 = 0\degree.

  2. Determine the longitude and latitude of Rio de Janeiro – our final point. We can find that ϕ2=22.97°\phi_2 = -22.97\degree (negative, because it lies in the southern hemisphere) and λ2=43.18°\lambda_2 = -43.18\degree (also negative, because it lies in the western hemisphere).

  3. Calculate the change in latitude:

Δϕ=ϕ2ϕ1=22.97°51.50°=74.47°\footnotesize \qquad \begin{align*} \Delta\phi &= \phi_2 - \phi_1\\ &= -22.97\degree - 51.50\degree\\ &= -74.47\degree \end{align*}
  1. Calculate the change in longitude:
Δλ=λ2λ1=43.18°0°=43.18°\footnotesize \qquad \begin{align*} \Delta\lambda &= \lambda_2 - \lambda_1\\ &= -43.18\degree - 0\degree\\ &= -43.18\degree \end{align*}
  1. Insert all of the data into the Haversine formula to calculate the distance:
a=sin2(Δϕ2) +cosϕ1cosϕ2sin2(Δλ2)=sin2(74.47°2)+cos(51.50°)cos(22.97°)sin2(43.18°2)= 0.443d= 2R arctan2(a,1a)= 2×6371× arctan2(0.443,10.443)= 9289 km\footnotesize \quad\enspace \begin{align*} a = &\sin^2\left(\frac{\Delta\phi}{2}\right)\ +\\ &\cos \phi_1 \cos\phi_2 \sin^2\left(\frac{\Delta\lambda}{2}\right)\\ = &\sin^2\left(\frac{-74.47\degree}{2}\right) +\\ &\cos (51.50\degree)\cos(-22.97\degree)\\ &\sin^2\left(\frac{-43.18\degree}{2}\right)\\ = &\ 0.443\\\\ d = &\ 2R\ \text{arctan2}(\sqrt{a}, \sqrt{1 - a})\\ = &\ 2\times 6371 \times\\ &\ \text{arctan2}(\sqrt{0.443}, \sqrt{1 - 0.443})\\ = &\ 9289\ \text{km} \end{align*}
  1. Calculate the azimuth from the azimuth equation:
θ= arctan2(sinΔλcosϕ2,cosϕ1sinϕ2 sinϕ1cosϕ2cosΔλ)= arctan2(sin(43.18°)cos(22.97°),cos(51.50°)sin(22.97°) sin(51.50°)cos(22.97°)cos(43.18°))=2.455 rad\footnotesize \quad\enspace \begin{align*} \theta =\ &\text{arctan2}(\sin\Delta\lambda\cos\phi_2,\\ &\cos\phi_1\sin\phi2\ -\\ &\sin\phi_1\cos\phi_2\cos\Delta\lambda)\\\\ =\ &\text{arctan2}(\sin(-43.18\degree)\\ &\cos(-22.97\degree),\\ &\cos(51.50\degree)\sin(-22.97\degree)\ -\\ &\sin(51.50\degree)\cos(-22.97\degree)\\ &\cos(-43.18\degree))\\\\ = & -\!2.455\ \text{rad} \end{align*}
  1. Convert the azimuth to a positive degree value:
θ=2.455 rad=140.65°=219.35°\footnotesize \quad\enspace \begin{align*} \theta &= -2.455\ \text{rad}\\ &= -140.65\degree\\ &= 219.35\degree \end{align*}
  1. Congratulations! You have just calculated azimuth from latitude and longitude.
Bogna Szyk
Starting point
Final point
Check out 141 similar other uncategorized calculators
3D printing cost3D render timeAge on other planets… 138 more
People also viewed…

Hamming distance

How much do two messages differ? Learn with our Hamming distance calculator!

Hyperfocal distance

Find out where to focus your camera to achieve the greatest depth of field using this hyperfocal distance calculator.

Plastic Footprint

Find out how much plastic you use throughout a year with this plastic footprint calculator. Rethink your habits, reduce your plastic waste, and make your life a little greener.

Significant figures

The significant figures calculator performs operations on sig figs and shows you a step-by-step solution!
Omni Calculator
Copyright by Omni Calculator sp. z o.o.
Privacy policy & cookies
main background