36#ifndef LIB2GEOM_SEEN_LINEAR_H
37#define LIB2GEOM_SEEN_LINEAR_H
51 : boost::additive< Linear
52 , boost::arithmetic< Linear, Coord
53 , boost::equality_comparable< Linear
75 bool isFinite()
const {
return std::isfinite(
a[0]) && std::isfinite(
a[1]); }
87 std::vector<Coord>
result(n+1, 0.0);
106 return (
a[1] +
a[0])/2;
123 a[0] += x;
a[1] += x;
127 a[0] -= x;
a[1] -= x;
131 a[0] *= x;
a[1] *= x;
135 a[0] /= x;
a[1] /= x;
144 return a[0] == other.
a[0] &&
a[1] == other.
a[1];
Range of real numbers that is never empty.
Function that interpolates linearly between two values.
Coord operator()(Coord t) const
Linear & operator+=(Linear const &other)
Linear & operator-=(Coord x)
Coord valueAt(Coord t) const
OptInterval bounds_local(double u, double v) const
Coord operator[](unsigned i) const
Linear & operator*=(Coord x)
Coord & operator[](unsigned i)
bool isZero(Coord eps=EPSILON) const
std::vector< Coord > valueAndDerivatives(Coord t, unsigned n)
bool operator==(Linear const &other) const
Linear & operator+=(Coord x)
bool isConstant(Coord eps=EPSILON) const
OptInterval bounds_fast() const
Linear & operator-=(Linear const &other)
Linear & operator/=(Coord x)
OptInterval bounds_exact() const
Linear(Coord aa, Coord b)
Range of real numbers that can be empty.
Polynomial in symmetric power basis.
constexpr Coord lerp(Coord t, Coord a, Coord b)
Numerically stable linear interpolation.
double Coord
Floating point type used to store coordinates.
constexpr Coord EPSILON
Default "acceptably small" value.
Simple closed interval class.
Low level math functions and compatibility wrappers.
Various utility functions.
Geom::SBasisOf< double > SBasis
Bezier reverse(const Bezier &a)
Bezier portion(const Bezier &a, double from, double to)
bool are_near(Affine const &a1, Affine const &a2, Coord eps=EPSILON)