.. role:: blue :class: blue MbFunction Function =================== .. _MbFunction_Function_: .. kernel version: 1180XX The :blue:`MbFunction` class is declared in the *function.h* file. The :blue:`MbFunction` function is an abstract class derived from the :ref:`MbRefItem ` and :blue:`TapeBase` classes, see the figure: .. figure:: /MODELER/SPECIAL_OBJECTS/pictures/O.6.1.1.png :width: 12cm :align: center In the C3D geometric kernel, the following scalar functions are implemented, which are derived from the :blue:`MbFunction` class: :ref:`MbConctFunction ` – constant function, :ref:`MbLineFunction ` – linear function, :ref:`MbCubicFunction ` – cubic Hermite function, :ref:`MbCubicSplineFunction ` – cubic spline function, :ref:`MdCharacterFunction ` – analytical function. MbFunction is a scalar function .. math:: \textit{function}( \textit{t} ) = \textit{f}( \textit{t} ) of a scalar parameter *t* that takes values on the segment [ *t*\ :sub:`min`, *t*\ :sub:`max` ]. The range of variation of the function parameter is the segment [ *t*\ :sub:`min`, *t*\ :sub:`max` ] in a one-dimensional space. The function *f*\(*t*\) must be single-valued and continuous. The boundary values *t*\ :sub:`min` and *t*\ :sub:`max` of the parameter domain are returned by the methods double :blue:`GetTMin`\() and double :blue:`GetTMax`\(), respectively. A function is called periodic if there exists *p* > 0 such that *f*\(*t* ± *kp*) = *f*\(*t*), where *k* is an integer. The :blue:`IsClosed`\() method of a periodic function returns true. The double :blue:`GetPeriod`\() method of a periodic function or a function that can be extended to a periodic one returns the period *p*. The domain of the parameter of a periodic function always lies within a single period. The main method of the function is double :blue:`Value`\( double & *t* ). It returns the function value for the given parameter *t*. The methods double :blue:`FirstDer`\( double & *t* ), double :blue:`SecondDer`\( double & *t* ), double :blue:`ThirdDer`\( double & *t* ) return the first, second, and third derivatives of the function, respectively, for the given parameter *t*. The listed methods adjust the function parameter when it goes beyond the domain. When the parameter *t* goes beyond the segment [ *t*\ :sub:`min`, *t*\ :sub:`max` ], non-periodic functions shift the parameter *t* to the nearest boundary *t*\ :sub:`min` or *t*\ :sub:`max`, while periodic functions add or subtract the required number of periods. The method double :blue:`\_Value`\( double *t* ) returns the function value for the given parameter *t* both within the parameter domain and outside it. In the general case, a non-periodic function outside its parameter domain is continued along the tangent at the endpoint. Analytical functions are an exception. Periodic functions outside the parameter domain are continued cyclically. The methods double :blue:`\_FirstDer`\( double *t* ), double :blue:`\_SecondDer`\( double *t* ), double :blue:`\_ThirdDer`\( double *t* ) return the first, second, and third derivatives of the function, respectively, for the given parameter *t* both within the function domain and outside it. Functions override the following methods: methods that provide copying, checking for equality, checking the ability to make objects equal, and making objects equal, MbFunction & :blue:`Duplicate`\(), Boolean :blue:`IsSame`\( const MbFunction & **item** ), Boolean :blue:`IsSimilar`\( const MbFunction & **item** ), Boolean :blue:`SetEqual`\( const MbFunction & **item** ), a method that returns the type from the function enumeration, MbeFunctionType :blue:`IsA`\(), methods that provide access to and editing of the internal data of the object, MbProperty & :blue:`CreateProperty`\( MbePrompt name ), void :blue:`GetProperties`\( MbProperties & *properties* ), void :blue:`SetProperties`\( MbProperties & *properties* ). All functions generally have no breaks. The :blue:`MbAnaliticalFunction` function defined by the user must also be continuous and have no singular points.