Crates.io | wmm |
lib.rs | wmm |
version | 0.2.3 |
source | src |
created_at | 2020-08-07 21:48:58.759693 |
updated_at | 2022-11-14 09:53:16.486843 |
description | WMM no_std library used to calculate the magnetic declination |
homepage | |
repository | https://github.com/sevenseas-io/wmm |
max_upload_size | |
id | 274134 |
size | 36,684 |
Low footprint no_std
World Magnetic Model (WMM) library used to calculate the magnetic declination at sea level.
It's important to note that the current model is valid from 2020 until 2025.
use time::OffsetDateTime;
use wmm::declination;
fn main() {
let date = OffsetDateTime::now_utc().date();
let lat = 29.7363025;
let lon = -93.8827939;
let dec = declination(date, lat, lon).unwrap();
println!(
"Today's declination for coordinates {},{} is {}°",
lat, lon, dec
)
}
This crate is guaranteed to compile on stable Rust 1.59 and up.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
The C code this library refences originates from WMM_Tiny.
The WMM is a NOAA effort which is part of the US Government.