Skip to main content

Field

Trait Field 

Source
pub trait Field {
    // Required methods
    fn potential(&self, r: f64, lat: f64, lon: f64) -> f64;
    fn vector(&self, r: f64, lat: f64, lon: f64) -> [f64; 3];

    // Provided method
    fn magnitude(&self, r: f64, lat: f64, lon: f64) -> f64 { ... }
}
Expand description

A static field with a scalar potential V, evaluated at geocentric radius r (m), latitude lat and longitude lon (radians).

Required Methods§

Source

fn potential(&self, r: f64, lat: f64, lon: f64) -> f64

The scalar potential V at the point, in the field’s own units.

Source

fn vector(&self, r: f64, lat: f64, lon: f64) -> [f64; 3]

The field vector in local (north, east, up) components, in the field’s own units: ∇V for gravity (m/s²), −∇V for a magnetic field (nT for the geomagnetic models). Undefined exactly at a pole, where east has no direction.

Provided Methods§

Source

fn magnitude(&self, r: f64, lat: f64, lon: f64) -> f64

The field’s magnitude at the point.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§