pub trait CompassModel {
// Required method
fn deviation(
&self,
course: Direction<Compass>,
) -> Result<Deviation, KernelError>;
}Expand description
Ship’s magnetism as compass deviation.
Swung table, Smith coefficients or calibrated fluxgate. Deviation is a function of the compass course (what is read on the card), not the magnetic course; the inverse is a solve performed by the algorithms.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl CompassModel for DeviationTable
Table read with the default
InterpolationMethod::Linear.
Linear is exact at nodes and never overshoots, the safe default. For a
smoother curve, or to prepare a spline once instead of per call, use
DeviationTable::interpolated.
impl CompassModel for InterpolatedTable<'_>
impl CompassModel for SmithCoefficients
Five-coefficient model as a CompassModel.
SmithCoefficients::deviation_at returns a plain f64 because a fit can
produce absurd values; here a Deviation is required, so such values
yield KernelError::OutOfRange.