Trait metfor::VectorQuantity [−][src]
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, { ... } }
Expand description
A version of Quantity
for vectors.
Required methods
Create a new instance of self by wrapping some values. This must be x-y coordinates from the standard cartesian coordinate system.
Unpack a wrapped value without any error checking. The returned values represent the vector in a standard x-y cartesian coordinate system.
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)>
[src]
fn into_option(self) -> Option<(S, S)>
[src]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.
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,
[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]Test whether these two vectors are close by looking at the magnitude of their difference.