Sextant

A sextant is an old nautical instrument to measure the angle between the sun and the horizon. Together with a clock, this can be used to determine the observer's position on the earth. In the following, it is first motivated why a sextant can still be useful although we have much more precise and easier ways to determine the position like GPS. Then, the sextant is introduced in more detail, limitations are mentioned and other approaches are discussed before going into the actual computations involved in determining the position using a sextant measurement. To avoid doing the computations by hand, the sextant calculator can be used, which is implemented as a Rust library executed in the browser via WebAssembly. The sextant emulator uses the camera and the gyroscope of the device (e.g. smartphone) to do a sextant measurement without needing a real sextant.

Motivation

Today, GPS and other satellite-based systems like Galileo (EU), Glonass (Russia) and BeiDou (China) are commonly used by airplanes, ships, cars and smartphones to determine their position. However, the signals of these systems can be disturbed by speical form of radio signal jamming called GPS jamming. This is commonly used by the military to prevent GPS-guided missiles to find their target. Consequently, GPS jamming can be observed in conflict zones, as shown by the GPS jamming maps by gpsjam.org and flightradar24.com. Examples include GPS blocking in Israel, in North Korea and in the Baltic Sea. Especially in the Baltic Sea, GPS disruptions are a problem for airlines, causing them to stop flying to certain destinations as well as for navigation on (sailing) ships.

Solution

Since GPS jamming is threat to the safe operation of many widely-used services, a robust backup solution is needed. One approach is celestial navigation, i.e. using a sextant. The idea was proposed by John Hadley, Thomas Godfrey and Isaac Newton around the year 1731, so it can be called a battle-tested technology. With the help of a sextant, the angle of the sun relative to the horizon (or to a artificial horizon, a fluid-filled tube with bubble) is measured at culmination, i.e. at the time of the highest point of the sun, which is around noon. Together with the time of culmination from a sufficiently precise clock (a challenge back in the time), the position (latitude, longitude) can be calculated (see Calculation for details). This library aims to implement these tedious and error-prone calculations.

Limitations & Other Approaches

The accuracy of a position calculated by a sextant measurement can vary from a few kilometers/miles to a several dozen kilometers/miles, depending on the accuracy of the measurement. Therefore, sextant navigation is not suitable for close navigation (e.g. inside a city), but rather for long-distance navigation (e.g. on the open sea). A project aiming to improve the resilience of GPS in the Baltic sea is the R-Mode Baltic project terrestrial positioning system, which "allows positioning even in times when the Global Navigation Satellite Systems (GNSS) fail."

Calculation

This section explains how to calculate the geographic position using a sextant. If you have a real sextant, you can follow the instructions on Wikipedia or on marineinsight.com to obtain an elevation measurement before starting with the math. Alternatively, the sextant emulator uses the gyroscope in your smartphone to determine the angle of the sun and automatically performs the required calcualtions. The calculations for latitude (i.e. north-south position) and a longitude (i.e. east-west position) used in the geographic coordinate system (GCS) are explained separately in the sections latitude and longitude, respectively. The equations in this section are based on:

General Solar Position Calculations by the NOAA Global Monitoring Division, 2017.
Retrieved from noaa.gov.

Latitude

The general idea for calculating the latitude, i.e. the north-south position, is the observation that the closer you get to the equator, the higher the sun will be, i.e. the steeper the sun's rays will hit the earth. This is also why it's usually warmer around the equator than at the poles. Therefore, you should be able to make an educated guess whether you are close to the equator or the poles based on the angle of the sun. With a sextant, you can actually measure the angle between the sun compared and the horizon (elevation) precisely.

Sun Declination

However, you also need to consider seasons: During the winter months, the sun's rays hit the earth more flatly than during summer. So to actually make a calculation instead of an educated guess, you would need to know the date of the measurement and compensate for the season somehow. This season-dependent sun angle is called sun declination (\( \text{decl} \)) and, as you might have guessed it, can be calculated using the day of the year (\( d_y \)) and a trigonometric function (i.e. cos). So the sun declination is:

\( \text{decl} = -23.45° \cdot cos(\frac{360}{365}) \cdot (d_y + 10) \)

with

Sun declination plot
Plot of the sun declination over the days of a year.

In this equation, you can see that the "shortest" day (i.e. winter solstice) is 10 days earlier than the first day of the year (1st of January). This is because the shortest day of the year is around December 21st (in the northern hemisphere). Also, you can see that the minimum/maximum value of disturbance ±23.45° (when the cos is 1), which is the axial tilt of the earth compared to its axis around the sun. For further details about how to retrieve this formula, see the Wikipedia article about the position of the sun.

Latitude Calculation

\( \text{lat} = 90° - (e_{s,c} - \text{decl}) \)

with

To compensate for the fact that on the equator one would measure an elevation of 90° (if the sun declination is 0° at solstice for simplicity), but the equator is defined as having a latitude of 0°, we need to subtract the corrected elevation from 90°, as done in the equation above.

Longitude

The idea for the longitude, i.e. the east-west position, is that the earth rotates under the sun, so the sun will raise in eastern countries before it raises at western countries, which is why we have time zones. For example, Helsinki/Finland uses UTC+2 while London/UK uses UTC (both in winter, i.e. without daylight saving time). This way, both locations see the sun in its highest point at around 12 o'clock local time. So if you observe the time at which the sun was at its highest point, you can calculate the difference between when you experienced the culmination and when a certain reference location experienced the culmination (via a lookup for the day of the year). This difference can the be used to map it to a longitude difference. Preferably, you use the prime meridian as reference, because it has the longitude 0°, so your longitude difference will be the actual longitude.

\( \text{lng} = (t_{c,r} - t_{c,p}) \cdot \frac{180°}{12 h} \)

with:

Decimal hours

A decimal hour is a mapping of hours and minutes (i.e. hh:mm) to a decimal number, so for example 1:30 pm = 13:30 = 13.5 hours.

\( t_h + \frac{t_m}{60 \frac{min}{h}} \)

with

Example:

Consider the time 1:04 pm = 13:04, i.e. \( t_h = 13 \) and \( t_m = 4 \):

\( t_h + \frac{t_m}{60 \frac{min}{h}} = 13 \; h + \frac{4 \\; min}{60 \frac{min}{h}} = \frac{13 \; h \cdot 60 \frac{min}{h}}{60 \frac{min}{h}} + \frac{4 \; min}{60 \frac{min}{h}} = \frac{784 \; min}{60 \frac{min}{h}} = \frac{196}{15} h = 13.0 \bar{6} h \)

Culmination at Prime Meridian

Fractional Year:

\( \gamma = \frac{2 * \pi}{365} * (d_y - 1 + \frac{h - 12}{24}) \)

with

Equation of Time (in Minutes):

\( \text{eqtime} = 229.18 \cdot ( 0.000075 + 0.001868 \cdot \\cos(\gamma) - 0.032077 \cdot \sin(\\gamma) - 0.014615 \cdot \cos(2\gamma) - 0.040849 \cdot \sin(2\gamma) ) \)

Time Offset:

\( \text{time_offset} = \text{eqtime} + 4 \cdot \text{longitude} - 60 \cdot \text{timezone} \)

with

Time of Solar Noon (in Minutes):

\( \text{tst} = \text{hr} \cdot 60 + \text{mn} + \frac{\text{sc}}{60} + \text{time_offset} \)