Skip to main content

MagneticField

Struct MagneticField 

Source
#[non_exhaustive]
pub struct MagneticField {
Show 15 fields pub north_nt: f64, pub east_nt: f64, pub down_nt: f64, pub horizontal_nt: f64, pub total_nt: f64, pub inclination_rad: f64, pub declination_rad: f64, pub grid_variation_rad: Option<f64>, pub north_rate_nt_per_year: f64, pub east_rate_nt_per_year: f64, pub down_rate_nt_per_year: f64, pub horizontal_rate_nt_per_year: f64, pub total_rate_nt_per_year: f64, pub inclination_rate_rad_per_year: f64, pub declination_rate_rad_per_year: f64,
}
Expand description

The magnetic elements at one place and time, and their rates of change.

Components are in the local geodetic north-east-down frame of the WGS 84 ellipsoid, as the report gives them (hpr’s launch frame is east-north-up: see MagneticField::enu_nt); angles are in radians; rates are per year.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§north_nt: f64

X, the northward component, nT.

§east_nt: f64

Y, the eastward component, nT.

§down_nt: f64

Z, the downward component, nT.

§horizontal_nt: f64

H = √(X² + Y²), the horizontal intensity, nT.

§total_nt: f64

F = √(H² + Z²), the total intensity, nT.

§inclination_rad: f64

I = atan2(Z, H), the inclination or dip, rad, positive down.

§declination_rad: f64

D = atan2(Y, X), the declination, rad, positive east of true north.

§grid_variation_rad: Option<f64>

The grid variation poleward of 55° (report, equation 1): D − λ north of 55° N, D + λ south of 55° S, in (−π, π]; None elsewhere.

§north_rate_nt_per_year: f64

Ẋ, nT per year.

§east_rate_nt_per_year: f64

Ẏ, nT per year.

§down_rate_nt_per_year: f64

Ż, nT per year.

§horizontal_rate_nt_per_year: f64

Ḣ = (X Ẋ + Y Ẏ) / H, nT per year.

§total_rate_nt_per_year: f64

Ḟ = (X Ẋ + Y Ẏ + Z Ż) / F, nT per year.

§inclination_rate_rad_per_year: f64

İ = (H Ż − Z Ḣ) / F², rad per year.

§declination_rate_rad_per_year: f64

Ḋ = (X Ẏ − Y Ẋ) / H², rad per year. The grid variation changes at the same rate.

Implementations§

Source§

impl MagneticField

Source

pub fn enu_nt(&self) -> DVec3

The field as east, north and up components, nT: (Y, X, −Z), the axes of hpr’s launch frame (docs/physics/frames.md).

Source

pub fn compass_zone(&self) -> CompassZone

The compass zone at this place, from the horizontal intensity (report, section 1.8). A horizontal intensity that is not a number counts as the blackout zone.

Source

pub fn declination_uncertainty_rad(&self) -> f64

The model’s own estimate of its declination error, one standard deviation, rad (report, section 3.4, equation 43):

δD = √(0.26² + (5417 / H)²)   degrees, with H in nT

About 0.29° where the field is strongest and growing without bound toward a magnetic pole. It covers the coefficients’ and the forecast’s errors, the crust’s local fields the model leaves out, and magnetic storms; a steel rail or car beside a compass adds its own. The report fits it on the ellipsoid’s surface; at height it uses that height’s H, which is weaker, so the estimate grows a little (negligibly at a rocket’s heights).

Source

pub fn true_from_magnetic_rad(&self, magnetic_bearing_rad: f64) -> f64

A true bearing from a magnetic one: true = magnetic + D, rad, in [0, 2π).

Trait Implementations§

Source§

impl Clone for MagneticField

Source§

fn clone(&self) -> MagneticField

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MagneticField

Source§

impl Debug for MagneticField

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MagneticField

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for MagneticField

Source§

fn eq(&self, other: &MagneticField) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for MagneticField

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for MagneticField

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.