#magnetic #model #calculate #world #time #low #declination

no-std wmm

WMM no_std library used to calculate the magnetic declination

8 releases

0.2.3 Nov 14, 2022
0.2.2 Nov 14, 2022
0.2.1 Feb 11, 2022
0.2.0 Oct 28, 2021
0.1.1-beta.1 Aug 9, 2020

#211 in Science

Download history 25/week @ 2023-12-18 14/week @ 2024-01-22 3/week @ 2024-01-29 5/week @ 2024-02-05 55/week @ 2024-02-19 17/week @ 2024-02-26 39/week @ 2024-03-04

111 downloads per month

MIT/Apache

19KB
405 lines

wmm

ci license version minimum rustc: 1.59 docs

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.

Example

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
    )
}

Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.59 and up.

License

Licensed under either of

at your option.

Contribution

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.

Credits

The C code this library refences originates from WMM_Tiny.

The WMM is a NOAA effort which is part of the US Government.

Dependencies

~1MB
~19K SLoC