CubicSpline.h 397 B

123456789101112131415161718
  1. #ifndef CUBICSPLINE_H
  2. #define CUBICSPLINE_H
  3. #include <vector>
  4. #include <utility>
  5. class CubicSpline
  6. {
  7. /// contains x, y and y' of each interpolation point
  8. std::vector<std::tuple<float, float, float>> points;
  9. bool useSlopes;
  10. public:
  11. CubicSpline(const std::vector<std::pair<float, float>>& dataPoints, bool useSlopes);
  12. float interpolateAt(float x);
  13. };
  14. #endif // CUBICSPLINE_H