curve-derivative-lowcase-GlobalFunction
Simple derivative calculations without smoothing. Missing values are ignored. Derivative is computed by taking the average of the two data points slopes from the previous and next data points.
bool curve_derivative( curvebase & cuv )
FALSE if not enough data to compute derivatives, else return TRUE
EX1
void curve_derivative_ex1() { vector vx, vy; vx.Data(-4.5, 6.7, 0.23); vy.Data(1, vx.GetSize()); Curve crv(vx, vy); vector vderiv; vderiv = vy; if(curve_derivative(crv)) { Worksheet wks; wks.Create(); wks.SetSize(-1, 3); Dataset da(wks, 0); da = vx; Dataset db(wks, 1); db = vy; Dataset dc(wks, 2); vderiv = crv; dc = vderiv; } }
Curve_derivative
origin.h