pub struct Covariance { /* private fields */ }Expand description
The covariance of a spread of points on the ground, m². It serializes as its three entries and
reads back through Covariance::new’s checks.
Implementations§
Source§impl Covariance
impl Covariance
Sourcepub fn new(
east_m2: f64,
north_m2: f64,
east_north_m2: f64,
) -> Result<Self, AnalysisError>
pub fn new( east_m2: f64, north_m2: f64, east_north_m2: f64, ) -> Result<Self, AnalysisError>
The covariance with the variances east_m2 and north_m2 and the covariance
east_north_m2.
§Errors
AnalysisError::Domain for an entry that isn’t finite, a negative variance, or a
covariance larger than the variances allow (|east_north| > √east √north, so the matrix
isn’t positive semi-definite), beyond four units of rounding: a covariance of points on a
line, computed in floating point, can pass the bound by that much.
Sourcepub fn east_north_m2(&self) -> f64
pub fn east_north_m2(&self) -> f64
The covariance of east and north, m².
Sourcepub fn principal_axes(&self) -> PrincipalAxes
pub fn principal_axes(&self) -> PrincipalAxes
The eigenvalues and the major axis’s heading (the module’s docs). The smaller eigenvalue is
taken as (ac − b²)/λ₁, the determinant over the larger, rather than
(a + c)/2 − √(…), whose subtraction loses every digit of a spread much narrower than it
is long; it is cut at zero, since rounding can take the determinant just below for points
on a line.
Trait Implementations§
Source§impl Clone for Covariance
impl Clone for Covariance
Source§fn clone(&self) -> Covariance
fn clone(&self) -> Covariance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Covariance
Source§impl Debug for Covariance
impl Debug for Covariance
Source§impl<'de> Deserialize<'de> for Covariance
impl<'de> Deserialize<'de> for Covariance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Covariance
impl PartialEq for Covariance
Source§fn eq(&self, other: &Covariance) -> bool
fn eq(&self, other: &Covariance) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Covariance
impl Serialize for Covariance
impl StructuralPartialEq for Covariance
Auto Trait Implementations§
impl Freeze for Covariance
impl RefUnwindSafe for Covariance
impl Send for Covariance
impl Sync for Covariance
impl Unpin for Covariance
impl UnsafeUnpin for Covariance
impl UnwindSafe for Covariance
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more