CubicSpline.h 414 B

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