ferromagnetic/
lib.rs

1pub mod igrf;
2
3pub struct OrthogonalStrength {
4    /// North component (X) (nT)
5    pub north: f64,
6     /// East component (Y) (nT)
7    pub east: f64,
8    /// Down / Vertical component (Z) (nT)
9    pub down: f64,
10}
11
12impl Default for OrthogonalStrength {
13    fn default() -> Self {
14        OrthogonalStrength {
15            north: 0.0,
16            east: 0.0,
17            down: 0.0,
18        }
19    }
20}
21
22/// Components needed to determine Earth's magnetic field at a given location
23/// Detailed info: https://www.geomag.nrcan.gc.ca/mag_fld/comp-en.php
24pub struct MagneticComponents {
25    /// Declination (D) (degrees)
26    pub declination: f64,
27    /// Inclination (D) (degrees)
28    pub inclination: f64,
29    /// Horizontal intensity (H) (nT)
30    pub horizontal_intensity: f64,
31    /// Orthogonal strength components
32    pub orthogonal_strength: OrthogonalStrength,
33    /// Total intensity (F) (nT)
34    pub total_intensity: f64,
35}