Trait iron_shapes::concepts::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
Type used for area. This is typically a floating point number or a rational number.
type ManhattanArea: Num + Copy + PartialEq + PartialOrd
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.
type UnsignedArea: Num + Copy + PartialEq + PartialOrd
type UnsignedArea: Num + Copy + PartialEq + PartialOrd
Type for unsigned area.
type CoordinateDifference: Num + Signed + Copy + PartialEq + From<Self::Coord> + PartialOrd
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.
type CoordinateDistance: Num + Copy + PartialEq + From<Self::CoordinateDifference> + Float + PartialOrd
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.