Trait CoordinateConcept

Source
pub trait CoordinateConcept: CoordinateBase {
    type Area: Num + Signed + Copy + PartialEq + PartialOrd;
    type ManhattanArea: Num + Copy + PartialEq + PartialOrd;
    type UnsignedArea: Num + Copy + PartialEq + PartialOrd;
    type CoordinateDifference: Num + Signed + Copy + PartialEq + From<Self::Coord> + PartialOrd;
    type CoordinateDistance: Num + Copy + PartialEq + From<Self::CoordinateDifference> + Float + PartialOrd;
}
Expand description

Define the coordinate concept. This will be used to parametrize all other geometric concepts.

Required Associated Types§

Source

type Area: Num + Signed + Copy + PartialEq + PartialOrd

Type used for area. This is typically a floating point number or a rational number.

Source

type ManhattanArea: Num + Copy + PartialEq + PartialOrd

Type used for area which can be expressed without fractions. The datatype usually has a bigger range than Coord to avoid overflows during multiplications. For example when using i32 as Coord, a i64 is recommended as area type.

Source

type UnsignedArea: Num + Copy + PartialEq + PartialOrd

Type for unsigned area.

Source

type CoordinateDifference: Num + Signed + Copy + PartialEq + From<Self::Coord> + PartialOrd

Type for difference between coordinates. Typically the same type as Coord when Coord is signed.

Source

type CoordinateDistance: Num + Copy + PartialEq + From<Self::CoordinateDifference> + Float + PartialOrd

Type for distances. Typically a floating point type because distances cannot be represented in integers nor rationals.

Implementations on Foreign Types§

Source§

impl CoordinateConcept for f32

Source§

impl CoordinateConcept for f64

Source§

impl CoordinateConcept for i32

Implementors§