pub trait VectorQuantity: Copy + Debug + Display + Sized {
    fn pack_xy(_: (f64, f64)) -> Self;
    fn unpack_xy(self) -> (f64, f64);
    fn unwrap_xy(self) -> (f64, f64);
    fn into_option(self) -> Option<(f64, f64)>;
}
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.

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.

Implementors