Skip to main content

Crate sextant

Crate sextant 

Source
Expand description

§Sextant-Calculator

sextant-calculator calculates the geographic position (latitude, longitude) on the Earth’s surface using a sextant measurement.

§Motivation

GPS jamming is a special form of radio jamming, i.e. the intentional interference with GPS signals. GPS jamming is commonly used by the military to prevent GPS-guided missiles to find their target. Consequently, it 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.”

§Example

let culmination_time = {
	let hour = 60 * 60;
	let timezone = FixedOffset::east_opt(2 * hour).unwrap(); // CET
	NaiveDate::from_ymd_opt(2024, 8, 17).unwrap()
		.and_hms_opt(13, 30, 22).unwrap()
		.and_local_timezone(timezone).unwrap()
};

let sextant_measurement = SextantMeasurement {
	culmination_time,
	elevation: Angle::from(DegreeMinutesSeconds { degrees: 53, minutes: 46, seconds: 0.0 }),
	index_error: Angle::from(DegreeMinutesSeconds { degrees: 0, minutes: 0, seconds: 0.0 }),
};
 
let expected_latitude = coordinate::Latitude::new(Angle::from(Degrees(49.014)));
let actual_latitude = sextant_measurement.calculate_latitude();
let latitude_difference = actual_latitude.raw_angle - expected_latitude.raw_angle;
assert!(Degrees::from(latitude_difference).0.abs() < 1.0, "expected={:?} actual={:?}", expected_latitude.raw_angle, actual_latitude.raw_angle);
 
let expected_longitude = coordinate::Longitude::new(Angle::from(Degrees(8.404)));
let actual_longitude = sextant_measurement.calculate_longitude();
let longitude_difference = actual_longitude.raw_angle - expected_longitude.raw_angle;
assert!(Degrees::from(longitude_difference).0.abs() < 0.5, "expected={:?} actual={:?}", expected_longitude.raw_angle, actual_longitude.raw_angle);

Modules§

angle
The difference in direction of two rays.
coordinate
Latitude, Longitude, and Coordinate types.
hemisphere
Hemisphere of latitudes (i.e. northern or southern) and longitudes (i.e. eastern or western).

Structs§

SextantMeasurement
A measurement of the sun’s angle above the horizon (i.e. elevation) at the time of its highest point (i.e. culmination time).

Functions§

calculate_sun_declination
Calculates the sun declination for a given date.
culmination
Calculates the culmination time as specified by https://gml.noaa.gov/grad/solcalc/solareqns.PDF
reference_culmination
Calculates the culmination for the prime meridian by forwarding the date to the culmination function.