pub struct MagneticField { /* private fields */ }Expand description
Earth’s magnetic field at a point: north, east, down components in nT.
Derived quantities — declination, inclination, horizontal and total
intensity — are computed from the components, not stored.
Implementations§
Source§impl MagneticField
impl MagneticField
Sourcepub fn from_ned_nanotesla(north: f64, east: f64, down: f64) -> Result<Self>
pub fn from_ned_nanotesla(north: f64, east: f64, down: f64) -> Result<Self>
Field from north, east, down components in nT.
§Errors
KernelError::NotFinite for a non-finite component;
KernelError::OutOfRange beyond ±MAX_FIELD_NANOTESLA.
Sourcepub const fn north_nanotesla(&self) -> f64
pub const fn north_nanotesla(&self) -> f64
North component, nT.
Sourcepub const fn east_nanotesla(&self) -> f64
pub const fn east_nanotesla(&self) -> f64
East component, nT.
Sourcepub const fn down_nanotesla(&self) -> f64
pub const fn down_nanotesla(&self) -> f64
Down component, nT; positive in the northern magnetic hemisphere.
Sourcepub fn horizontal_intensity_nanotesla(&self) -> f64
pub fn horizontal_intensity_nanotesla(&self) -> f64
Horizontal intensity H, nT: the component that aligns a compass.
Small near the magnetic poles, where a compass becomes sluggish and then unusable.
Sourcepub fn total_intensity_nanotesla(&self) -> f64
pub fn total_intensity_nanotesla(&self) -> f64
Total intensity F, nT.
Sourcepub fn declination(&self) -> Variation
pub fn declination(&self) -> Variation
Declination D (magnetic variation), east positive.
Undefined where H is zero and reported as zero; check
horizontal_intensity_nanotesla
before relying on a compass there.
Sourcepub fn inclination(&self) -> Angle
pub fn inclination(&self) -> Angle
Inclination I (dip): angle below the horizontal, positive down.