Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.
/ libgeomag Public archive

Rust library for geomagnetic field models

License

Notifications You must be signed in to change notification settings

SanmerDev/libgeomag

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libgeomag

Rust library for calculating geomagnetic field models

usage

[dependencies.geomag]
git = "https://github.com/SanmerDev/libgeomag.git"

usage (no-std)

[dependencies.geomag]
git = "https://github.com/SanmerDev/libgeomag.git"
features = ["libm"]

demo

use geomag::*;

fn main() {
    let l = GeodeticLocation::new(102.0, 24.0, 1900.0);
    let t = DateTime::new(2023, 11, 1, 0, 0, 0).unwrap();

    let wmm = WMM::new(t.decimal()).unwrap();
    let igrf = IGRF::new(t.decimal()).unwrap();

    let m = wmm.at_location(&l);
    println!("{:?}", m);

    let m = igrf.at_location(&l);
    println!("{:?}", m);
}

References