Tool to compute Azimuth: angle between the direction of an object and the geographic north in the horizontal plan from geographic coordinates.
Azimuth - dCode
Tag(s) : Geography
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
In cartography/navigation, an azimuth between two points is the angle (in the plane) formed by the straight line passing through the two points and the line passing through the two poles.
In other words, it is the angle formed between a given direction and north (measured clockwise from true or magnetic north).
It is generally expressed in degrees, from 0° (facing north) to 360° (returning to north after a complete rotation).
From 2 GPS points (Point 1: latitude $ lat_1 $, longitude $ long_1 $ and Point 2 latitude $ lat_2 $, longitude $ long_2 $), the formula to calculate an azimuth $ A $ is $$ A = \operatorname{atan2}(y, x) $$
with $ x = \cos(lat_1) \cdot \sin(lat_2) - \sin(lat_1) \cdot \cos(lat_2) \cdot \cos(long_2-long_1) $ and $ y = \sin(long_2-long_1) \cdot \cos(lat_2) $
Reminder: the arctan2 formula is $$ \operatorname{atan2}(y,x) = 2 \arctan \left( \frac{ y }{ \sqrt{x^2+y^2} + x } \right) $$
Angles are in radians (multiply an angle in degrees by $ \pi/180 $ to get an angle in radians)
Every hour, the Earth rotates on itself about 15 degrees, so every hour on Earth, the sun is seen 15 degrees further west.
By knowing the azimuth of the sun, solar time can be calculated. At noon, the sun is 180 degrees. Each difference of 15 degrees is 1 hour.
Example: The azimuth of the sun at 165 degrees: it is around 11 am.
Example: The azimuth of the sun at 210 degrees: it is about 2 pm.
The given time is Solar Time.
— Geographic azimuth: Measured relative to geographic north (true north).
— Magnetic azimuth: Measured relative to magnetic north indicated by the compass.
The difference between the two is called magnetic declination and depends on location and time.
Azimuth, with or without h, are 2 identical terms, despite the spelling variant, both spellings are accepted.
dCode retains ownership of the "Azimuth" source code. Any algorithm for the "Azimuth" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Azimuth" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Azimuth" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Azimuth" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Azimuth on dCode.fr [online website], retrieved on 2025-04-15,