MbFunction Function

The MbFunction class is declared in the function.h file.

The MbFunction function is an abstract class derived from the MbRefItem and TapeBase classes, see the figure:

../../../../_images/O.6.1.1.png

In the C3D geometric kernel, the following scalar functions are implemented, which are derived from the MbFunction class:

MbConctFunction – constant function,

MbLineFunction – linear function,

MbCubicFunction – cubic Hermite function,

MbCubicSplineFunction – cubic spline function,

MdCharacterFunction – analytical function.

MbFunction is a scalar function

\[\textit{function}( \textit{t} ) = \textit{f}( \textit{t} )\]

of a scalar parameter t that takes values on the segment [ tmin, tmax ]. The range of variation of the function parameter is the segment [ tmin, tmax ] in a one-dimensional space. The function f(t) must be single-valued and continuous.

The boundary values tmin and tmax of the parameter domain are returned by the methods double GetTMin() and double 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 IsClosed() method of a periodic function returns true. The double 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 Value( double & t ).

It returns the function value for the given parameter t.

The methods

double FirstDer( double & t ),

double SecondDer( double & t ),

double 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 [ tmin, tmax ], non-periodic functions shift the parameter t to the nearest boundary tmin or tmax, while periodic functions add or subtract the required number of periods.

The method

double _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 _FirstDer( double t ),

double _SecondDer( double t ),

double _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 & Duplicate(),

Boolean IsSame( const MbFunction & item ),

Boolean IsSimilar( const MbFunction & item ),

Boolean SetEqual( const MbFunction & item ),

a method that returns the type from the function enumeration,

MbeFunctionType IsA(),

methods that provide access to and editing of the internal data of the object,

MbProperty & CreateProperty( MbePrompt name ),

void GetProperties( MbProperties & properties ),

void SetProperties( MbProperties & properties ).

All functions generally have no breaks. The MbAnaliticalFunction function defined by the user must also be continuous and have no singular points.