.. role:: blue :class: blue MbCubicFunction Cubic Hermite Function ====================================== .. _MbCubicFunction_Cubic_Hermite_Function_: .. kernel version: The :blue:`MbCubicFunction` class is declared in the *cur_cubic_function.h* file. The Cubic Hermite function :blue:`MbCubicFunction` is defined by the set of control points *valueList*, the set of function derivatives at the control points *firctList*, the set of parameter values of the function at the control points *tList*, and the flag of periodicity of the function *closed*. The function also has some additional data that are optional and are used to speed up the work of the function methods. For the parameter value *tList*\[*i*\], *i* = 0, 1, ..., *splinesCount*, where *splinesCount* = *tList*.MaxIndex(), the Cubic Hermite function passes through the control point *valueList*\[*i*\] and has the derivative *firctList*\[*i*\] at this point. The function is constructed on the basis of *splinesCount* third-degree Hermite splines, which smoothly join each other. Each cubic Hermite spline describes a segment of the function between two neighboring control points. Each cubic Hermite spline is defined by two end points and two derivatives of the curve at these points. When evaluating the function, first, by the value of the curve parameter *t*, the index *i* of the working segment (the index of the cubic Hermite spline) is determined from the condition *tList*\[*i*\] ≤ *t* ≤ *tList*\[*i* + 1\]. Then the function is evaluated for the found working segment using its local parameter *w*, which is defined by *tList*\[*i*\] and *tList*\[*i* + 1\]. In the double :blue:`Value`\( double & *t* ) method, the following function is used: .. math:: f(t) = (1 - 3 w^{2} + 2 w^{3}) \, valueList[i] + (3 w^{2} + 2 w^{3}) \, valueList[i + 1] + \\ + \left( (w - 2 w^{2} + w^{3}) \, valueList[i] + (- w^{2} + w^{3}) \, valueList[i + 1] \right) ( tList[i + 1] - tList[i] ), where .. math:: w = \frac{ t - tList[i] }{ tList[i + 1] - tList[i] } is the local parameter of the working segment tList[i] ≤ t ≤ tList[i + 1]. The Cubic Hermite function is shown in Fig. 1: .. figure:: /MODELER/SPECIAL_OBJECTS/pictures/O.6.4.1.png :width: 15cm :align: center Fig. 1 The domain of the function parameter lies within *tmin* ≤ *t* ≤ *tmax*, where *tmin* = *tList*\[0\], *tmax* = *tList*\[*splinesCount*\]. The function can be periodic. The shape of the function depends on the positions of the control points, on the function derivatives at the control points, and on the *tList* set of parameter values at the control points. When the function is constructed only by control points, the derivatives *firctList*\[*i*\] are computed by constructing a parabola that passes through three neighboring points *valueList*\[*i* -- 1\], *valueList*\[*i*\], *valueList*\[*i* + 1\] at the corresponding parameter values *tList*\[*i* -- 1\], *tList*\[*i*\], *tList*\[*i* + 1\], and by evaluating the derivative of this parabola at the middle point.