geoprimsField-grade geospatial math

Compass check by the Sun

The Sun's true azimuth at a time and place, its amplitude at rising or setting, and the gyro or compass error against a bearing you observed

Planning and education aid. Not for primary navigation. Full disclaimer

Experimental: not yet fully verified. How results are checked

the Sun bore 302.7 degrees true, so the gyro error is 0.3W degrees

the Sun bore 302.7 degrees true, so the gyro error is 0.3 W degrees.

True azimuth
Azimuth angle
Azimuth angle written out
Computed altitude
Amplitude
Amplitude written out
Provenance
Computed by
navigation.celestial.sun-azimuth-check 1.0.0, core 0.1.0
Model
The Sun's apparent place from the same series as the almanac tool; Zn = atan2(-cos d sin LHA, cos L sin d - sin L cos d cos LHA) (Bowditch Appendix B); the amplitude from sin A = sin Dec / cos Lat, prefixed E rising or W setting and suffixed to agree with the declination (Bowditch §2017); the error as the true azimuth less the observed bearing, east positive, and the deviation as that error less the variation
Accuracy
Reproduces both worked gyro-error examples of Bowditch §2016 to the printed 0.1° of azimuth, and the amplitude of §2018 within 0.1° of the value its table interpolation gives. The Sun's own place is within 0.018′ of the US Naval Observatory
Reference data
version IERS Bulletin C 72 (2026-07-06) of a reference dataset
Notes
1 shown with the answer
Cites
National Geospatial-Intelligence Agency, The American Practical Navigator (Bowditch), NGA Pub. No. 9, Volume I; International Earth Rotation and Reference Systems Service (Petit and Luzum, eds.), IERS Conventions (2010), IERS Technical Note 36, Chapter 5; Bureau des Longitudes (now IMCCE), distributed by CDS Strasbourg, VSOP87 planetary theories (Bretagnon and Francou 1988), VizieR catalog VI/81; US Naval Observatory, Astronomical Applications Department, USNO Astronomical Applications API (celestial navigation and sidereal time)

Something look off?

Your values

Showing an example. Change anything.
More options 4
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: The Sun's apparent place from the same series as the almanac tool; Zn = atan2(-cos d sin LHA, cos L sin d - sin L cos d cos LHA) (Bowditch Appendix B); the amplitude from sin A = sin Dec / cos Lat, prefixed E rising or W setting and suffixed to agree with the declination (Bowditch §2017); the error as the true azimuth less the observed bearing, east positive, and the deviation as that error less the variation

Show your work

  1. Almanac data

    The Sun's apparent place for that second

    at 2024-07-24T14:30:00Z = GHA 35°51.8', Dec N 19°40.4'

  2. True azimuth

    Zn = atan2(-cos d sin LHA, cos L sin d - sin L cos d cos LHA)

    LHA 116°36.2', Lat 51°24.6' = Z N 57.3 W, Zn 302.7 degrees

  3. Amplitude

    sin A = sin Dec / cos Lat, on the celestial horizon

    Dec N 19°40.4', Lat 51°24.6' = W 32.7 N (302.7 degrees true)

  4. Compass error

    The true azimuth less the bearing observed

    302.7 - 303.0 degrees = the Sun bore 302.7 degrees true, so the gyro error is 0.3 W degrees

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Reproduces both worked gyro-error examples of Bowditch §2016 to the printed 0.1° of azimuth, and the amplitude of §2018 within 0.1° of the value its table interpolation gives. The Sun's own place is within 0.018′ of the US Naval Observatory

When to use this: Use this to check a gyro or magnetic compass against the Sun. Enter the second of the observation, your position, and the bearing you read. The tool returns the Sun's true azimuth, the amplitude for an observation taken at rising or setting, and the compass error, split into variation and deviation when you are checking a magnetic compass.

Limitations: The amplitude holds only at the moment the Sun's center is on the celestial horizon, which is not the moment it looks to be on the visible horizon; the note returned here says where to find it. Near the poles, and whenever the Sun is high, a small error in time or position moves the azimuth a long way, so take the sight low. The deviation returned is the error left after the variation you supply, so it is only as good as that variation. This does not correct a sextant altitude or give a position.

Worked example: Bowditch's setting Sun checked against a gyro reading of 303 degrees. Source: Bowditch 2024 §2018: at latitude 51°24.6'N with the Sun's declination N 19°40.4', the amplitude is W 32.6°N, a true bearing of 302.6°, so a gyro reading 303.0° is 0.4° W in error. The Sun holds that declination on 2024-07-24 at 14h30m UT and is setting then at longitude 80°44.4'E. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Observed bearing
303 deg
Compass
gyro
DUT1 (UT1 - UTC)
0 s
Latitude
51 24.6 N
Longitude
80 44.4 E
UTC time
2024-07-24T14:30:00Z

You get

Compass check
the Sun bore 302.7 degrees true, so the gyro error is 0.3 W degrees
True azimuth
302.7°
Azimuth angle
57.3°
Azimuth angle written out
N 57.3 W
Computed altitude
0°
Amplitude
32.7°
Amplitude written out
W 32.7 N
True bearing from the amplitude
302.7°
When to take the amplitude
The Sun's center is on the celestial horizon when its lower limb sits about two thirds of its own diameter above the visible horizon (Bowditch §2017).
Declination
19.6739°
LHA
116.6037°
Compass error
-0.3°
Compass error written out
0.3 W

Review: Not yet independently reviewed by a geodesist.

Last verified: 2026-09-19, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 31 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

DUT1: UT1 minus UTC
The difference between Earth-rotation time and UTC, always under 0.9 s, broadcast so users can recover UT1. Source: IERS Bulletin C (leap seconds)
IERS: International Earth Rotation and Reference Systems Service
The service that maintains the ITRF and Earth orientation data, and announces leap seconds in Bulletin C. Source: IERS Bulletin C (leap seconds)
LHA: local hour angle
How far west of your own meridian a body is, from 0 to 360 degrees: the Greenwich hour angle plus your longitude east, or minus it west. Source: The American Practical Navigator (Bowditch), NGA Pub. No. 9
UT1: Universal Time 1
Time kept by Earth's actual rotation. It drifts against atomic time, and UTC is kept within 0.9 s of it. Source: IERS Bulletin C (leap seconds)
UTC: Coordinated Universal Time
The world's civil time standard, kept within 0.9 s of Earth's rotation by leap seconds. Aviation calls it Zulu time, written with a Z. Source: IERS Bulletin C (leap seconds)

Experimental means this tool has not yet met the stable bar: at least 20 golden vectors, differential tests, and an independent worked example.