Function wmm::declination[][src]

pub fn declination(date: Date, lat: f32, lon: f32) -> Result<f32, Error>
Expand description

Returns the magnetic declination for a given date and location

Arguments

  • date - Date within the 2020 to 2025 time range
  • lat - Latitude: -90.00 to +90.00 degrees
  • lon - Longitude: -180.00 to +180.00 degrees

Examples

use time::{Date, Month};
use wmm::declination;
let date = Date::from_calendar_date(2021, Month::September, 1).unwrap();
let lat = 29.7363025;
let lon = -93.8827939;
let dec = declination(date, lat, lon).unwrap();