11 for (
int i=1; i<=n; i++)
13 powers[i] = powers[i-1]*x;
70 coeff_[1] = (pos2 - pos1) / duration;
98 coeff_[2] = (-3.0*pos1 + 3.0*pos2 - 2.0*vel1*T[1] - vel2*T[1]) / T[2];
99 coeff_[3] = (2.0*pos1 - 2.0*pos2 + vel1*T[1] + vel2*T[1]) / T[3];
126 coeff_[3] = (-20.0*pos1 + 20.0*pos2 - 3.0*acc1*T[2] + acc2*T[2] -
127 12.0*vel1*T[1] - 8.0*vel2*T[1]) / (2.0*T[3]);
128 coeff_[4] = (30.0*pos1 - 30.0*pos2 + 3.0*acc1*T[2] - 2.0*acc2*T[2] +
129 16.0*vel1*T[1] + 14.0*vel2*T[1]) / (2.0*T[4]);
130 coeff_[5] = (-12.0*pos1 + 12.0*pos2 - acc1*T[2] + acc2*T[2] -
131 6.0*vel1*T[1] - 6.0*vel2*T[1]) / (2.0*T[5]);
148 position = t[0]*
coeff_[0] +
163 velocity = t[0]*
coeff_[1] +
177 acceleration = 2.0*t[0]*
coeff_[2] +
virtual double Acc(double time) const
virtual ~VelocityProfile_Spline()
virtual void Write(std::ostream &os) const
virtual double Vel(double time) const
A spline VelocityProfile trajectory interpolation.
virtual double Duration() const
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
virtual VelocityProfile * Clone() const
virtual void SetProfileDuration(double pos1, double pos2, double duration)
virtual void SetProfile(double pos1, double pos2)
virtual double Pos(double time) const
static void generatePowers(int n, double x, double *powers)