quintic_spline.h 1.64 KB
 stonneau committed Jun 19, 2013 1 /**  Steve Tonneau committed Nov 25, 2016 2 * \file cubic_spline.h  stonneau committed Jun 19, 2013 3 4 5 6 7 * \brief Definition of a cubic spline. * \author Steve T. * \version 0.1 * \date 06/17/2013 *  stonneau committed Jun 27, 2013 8 9 10 * This file contains definitions for the CubicFunction struct. * It allows the creation and evaluation of natural * smooth cubic splines of arbitrary dimension  stonneau committed Jun 19, 2013 11 12 13 */  Steve Tonneau committed Nov 25, 2016 14 15 #ifndef _STRUCT_QUINTIC_SPLINE #define _STRUCT_QUINTIC_SPLINE  stonneau committed Jun 19, 2013 16 17  #include "MathDefs.h"  stonneau committed Jun 27, 2013 18   JasonChmn committed May 02, 2019 19 #include "polynomial.h"  stonneau committed Jun 19, 2013 20   stonneau committed Jun 27, 2013 21 22 #include  JasonChmn committed Apr 17, 2019 23 namespace curves  stonneau committed Jun 19, 2013 24 {  JasonChmn committed Sep 03, 2019 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46  /// \brief Creates coefficient vector of a quintic spline defined on the interval /// \f$[t_{min}, t_{max}]\f$. It follows the equation :
/// \f$x(t) = a + b(t - t_{min}) + c(t - t_{min})^2 + d(t - t_{min})^3 + e(t - t_{min})^4 + f(t - t_{min})^5 \f$
/// where \f$t \in [t_{min}, t_{max}] \f$. /// template T_Point make_quintic_vector(Point const& a, Point const& b, Point const& c, Point const &d, Point const& e, Point const& f) { T_Point res; res.push_back(a);res.push_back(b);res.push_back(c); res.push_back(d);res.push_back(e);res.push_back(f); return res; } template polynomial create_quintic(Point const& a, Point const& b, Point const& c, Point const &d, Point const &e, Point const &f, const Time t_min, const Time t_max) { T_Point coeffs = make_quintic_vector(a,b,c,d,e,f); return polynomial(coeffs.begin(),coeffs.end(), t_min, t_max); }  JasonChmn committed Apr 17, 2019 47 } // namespace curves  Steve Tonneau committed Nov 25, 2016 48 #endif //_STRUCT_QUINTIC_SPLINE  stonneau committed Jun 27, 2013 49