34#ifndef LIB2GEOM_SEEN_COORD_H
35#define LIB2GEOM_SEEN_COORD_H
41#include <boost/operators.hpp>
65template <Dim2 D,
typename T>
88constexpr Coord infinity() {
return std::numeric_limits<Coord>::infinity(); }
98 return (1 - t) * a + t * b;
118 boost::equality_comparable<
RectType
143 boost::equality_comparable<
IntRect
159 boost::equality_comparable<
Interval
168 boost::equality_comparable<
Rect
170 , boost::orable<
Rect
3x3 matrix representing an affine transformation.
Adaptor that creates 2D functions from 1D ones.
A range of numbers which is never empty.
A range of numbers that can be empty.
Axis-aligned generic rectangle that can be empty.
Axis aligned, non-empty, generic rectangle.
Two-dimensional point with integer coordinates.
Range of real numbers that is never empty.
Range of real numbers that can be empty.
Axis-aligned rectangle that can be empty.
Two-dimensional point that doubles as a vector.
Axis aligned, non-empty rectangle.
Contains forward declarations of 2geom types.
constexpr Coord lerp(Coord t, Coord a, Coord b)
Numerically stable linear interpolation.
Dim2
2D axis enumeration (X or Y).
int IntCoord
Type used for integral coordinates.
constexpr Dim2 other_dimension(Dim2 d)
Get the other (perpendicular) dimension.
constexpr Coord infinity()
Get a value representing infinity.
double Coord
Floating point type used to store coordinates.
GenericInterval< IntCoord > IntInterval
Range of integers that is never empty.
constexpr Coord EPSILON
Default "acceptably small" value.
GenericOptInterval< IntCoord > OptIntInterval
Range of integers that can be empty.
Various utility functions.
GenericRect< IntCoord > IntRect
Coord parse_coord(std::string const &s)
bool rel_error_bound(Coord a, Coord b, double eps=EPSILON)
GenericOptRect< IntCoord > OptIntRect
std::string format_coord_nice(Coord x)
std::string format_coord_shortest(Coord x)
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)
boost::equality_comparable< Interval, boost::equality_comparable< Interval, IntInterval, boost::additive< Interval, boost::multipliable< Interval, boost::orable< Interval, boost::arithmetic< Interval, Coord > > > > > > IntervalOps
boost::equality_comparable< Rect, boost::equality_comparable< Rect, IntRect, boost::orable< Rect, boost::orable< Rect, OptRect, boost::additive< Rect, Point, boost::multipliable< Rect, Affine > > > > > > RectOps
boost::equality_comparable< IntRect, boost::orable< IntRect, boost::orable< IntRect, OptIntRect, boost::additive< IntRect, IntPoint > > > > RectOps
boost::equality_comparable< IntInterval, boost::additive< IntInterval, boost::additive< IntInterval, IntCoord, boost::orable< IntInterval > > > > IntervalOps
Traits class used with coordinate types.
boost::equality_comparable< IntervalType, boost::orable< IntervalType > > IntervalOps
GenericInterval< C > IntervalType
boost::equality_comparable< RectType, boost::orable< RectType, boost::orable< RectType, OptRectType > > > RectOps
GenericRect< C > RectType
typename T::D1ConstReference D1ConstReference
typename T::D1Reference D1Reference
typename T::D1Value D1Value
typename D2Traits< T >::D1Value result_type
D2Traits< T >::D1Value operator()(T const &a) const