10 #include "SplineCoeff.h"
11 #include "SplinePair.h"
15 SPLINE_ENABLE_T_CHECK,
16 SPLINE_DISABLE_T_CHECK
38 Spline(
const std::vector<double> &t,
39 const std::vector<SplinePair> &xy,
40 SplineTCheck splineTCheck = SPLINE_ENABLE_T_CHECK);
53 double &aUntranslated,
54 double &bUntranslated,
55 double &cUntranslated,
56 double &dUntranslated)
const;
61 int numIterations)
const;
83 void checkTIncrements (
const std::vector<double> &t)
const;
85 void computeCoefficientsForIntervals (
const std::vector<double> &t,
86 const std::vector<SplinePair> &xy);
87 void computeControlPointsForIntervals ();
90 std::vector<SplineCoeff> m_elements;
93 std::vector<double> m_t;
96 std::vector<SplinePair> m_xy;
99 std::vector<SplinePair> m_p1;
100 std::vector<SplinePair> m_p2;
SplinePair interpolateCoeff(double t) const
Return interpolated y for specified x.
SplinePair interpolateControlPoints(double t) const
Return interpolated y for specified x, for testing.
Cubic interpolation given independent and dependent value vectors.
SplinePair p1(unsigned int i) const
Bezier p1 control point for specified interval. P0 is m_xy[i] and P3 is m_xy[i+1].
void computeUntranslatedCoefficients(double aTranslated, double bTranslated, double cTranslated, double dTranslated, double tI, double &aUntranslated, double &bUntranslated, double &cUntranslated, double &dUntranslated) const
From coefficients in xy=d*(t-ti)^3+c*(t-ti)^2+b*(t-ti)+a we compute and return the coefficients in xy...
SplinePair findSplinePairForFunctionX(double x, int numIterations) const
Use bisection algorithm to iteratively find the SplinePair interpolated to best match the specified x...
SplinePair p2(unsigned int i) const
Bezier p2 control point for specified interval. P0 is m_xy[i] and P3 is m_xy[i+1].
Unit test of spline library.
Single X/Y pair for cubic spline interpolation initialization and calculations.