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 between two points, our azimuth calculator uses the Haversine formula:
- – Latitude of the initial point (positive for N and negative for S);
- – Latitude of the final point (positive for N and negative for S);
- – Longitude of the initial point (positive for E and negative for W);
- – Longitude of the final point (positive for E and negative for W);
- is an intermediate step; and
- is the radius of the Earth, expressed in meters ().
Input latitudes and longitudes in the decimal degrees notation.
You can find the azimuth using the same latitudes and longitudes with the following equation:
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 (positive because it lies in the northern hemisphere) and .
Determine the longitude and latitude of Rio de Janeiro – our final point. We can find that (negative, because it lies in the southern hemisphere) and (also negative, because it lies in the western hemisphere).
Calculate the change in latitude:
- Calculate the change in longitude:
- Insert all of the data into the Haversine formula to calculate the distance:
- Calculate the azimuth from the azimuth equation:
- Convert the azimuth to a positive degree value:
- Congratulations! You have just calculated azimuth from latitude and longitude.