[][src]Trait metfor::VectorQuantity

pub trait VectorQuantity<S>: Copy + Debug + Sized where
    S: Quantity
{ fn pack_xy(_: (S, S)) -> Self;
fn unpack_xy(self) -> (S, S);
fn unwrap_xy(self) -> (S, S);
fn into_option(self) -> Option<(S, S)>;
fn abs(&self) -> S; fn approx_eq<RHS, T, TOL>(self, other: RHS, tol: TOL) -> bool
    where
        Self: From<RHS> + Sub<Self, Output = Self>,
        S: From<TOL> + From<T> + PartialOrd,
        RHS: VectorQuantity<T>,
        T: Quantity
, { ... } }

A version of Quantity for vectors.

Required methods

fn pack_xy(_: (S, S)) -> Self

Create a new instance of self by wrapping some values. This must be x-y coordinates from the standard cartesian coordinate system.

fn unpack_xy(self) -> (S, S)

Unpack a wrapped value without any error checking. The returned values represent the vector in a standard x-y cartesian coordinate system.

fn unwrap_xy(self) -> (S, S)

Unwrap the values from the new type and check validity, panic if contents are invalid. The returned values represent the vector in a standard x-y cartesian coordinate system.

fn into_option(self) -> Option<(S, S)>

Convert into an option that is None if the content is invalid. The returned values represent the vector in a standard x-y cartesian coordinate system.

fn abs(&self) -> S

Get the magnitude of the vector.

Loading content...

Provided methods

fn approx_eq<RHS, T, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + Sub<Self, Output = Self>,
    S: From<TOL> + From<T> + PartialOrd,
    RHS: VectorQuantity<T>,
    T: Quantity

Test whether these two vectors are close by looking at the magnitude of their difference.

Loading content...

Implementors

impl<S> VectorQuantity<S> for WindSpdDir<S> where
    S: Quantity + PartialOrd
[src]

fn approx_eq<RHS, T, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + Sub<Self, Output = Self>,
    S: From<TOL> + From<T> + PartialOrd,
    RHS: VectorQuantity<T>,
    T: Quantity
[src]

impl<S> VectorQuantity<S> for WindUV<S> where
    S: Quantity
[src]

fn approx_eq<RHS, T, TOL>(self, other: RHS, tol: TOL) -> bool where
    Self: From<RHS> + Sub<Self, Output = Self>,
    S: From<TOL> + From<T> + PartialOrd,
    RHS: VectorQuantity<T>,
    T: Quantity
[src]

Loading content...