1 #ifndef VTESTBED_GEOMETRY_LINEAR_INTERPOLATION_HH 2 #define VTESTBED_GEOMETRY_LINEAR_INTERPOLATION_HH 6 #include <vtestbed/geometry/curve_segments.hh> 7 #include <vtestbed/geometry/math.hh> 13 template <
class T,
int N=3>
17 using value_type = Vertex<T,N>;
18 using reference = value_type&;
19 using const_reference =
const value_type&;
21 using size_type = size_t;
33 this->_segments.normalise();
37 operator()(T t)
const {
38 const auto& segments = this->_segments;
39 const auto& points = this->_points;
41 segments.locate(t, i);
42 if (i == segments.size()) {
45 const auto& a = points[i];
46 const auto& b = points[i+1];
50 inline const_reference
51 front()
const noexcept {
52 return this->_points.front();
55 inline const_reference
56 back()
const noexcept {
57 return this->_points.back();
62 return this->_points.size();
67 return this->_segments;
72 return this->_segments;
77 this->_segments.range(min, max);
86 #endif // vim:filetype=cpp