e8f0fa2d27
- C3d aggiornamento delle librerie.
102 lines
7.2 KiB
C++
102 lines
7.2 KiB
C++
////////////////////////////////////////////////////////////////////////////////
|
|
/**
|
|
\file
|
|
\brief \ru Линейная функция.
|
|
\en Linear function. \~
|
|
|
|
*/
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef __FUNC_LINE_FUNCTION_H
|
|
#define __FUNC_LINE_FUNCTION_H
|
|
|
|
|
|
#include <function.h>
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
/** \brief \ru Линейная функция.
|
|
\en Linear function. \~
|
|
\details \ru Линейная функция. \n
|
|
\en Linear function. \n \~
|
|
\ingroup Functions
|
|
*/
|
|
// ---
|
|
class MATH_CLASS MbLineFunction : public MbFunction {
|
|
public :
|
|
double value1; ///< \ru Значение функции в начале области определения. \en A value of function in the beginning of its domain.
|
|
double value2; ///< \ru Значение функции в конце области определения. \en A value of function in the ending of its domain.
|
|
double tmin; ///< \ru Начало области определения. \en Beginning of domain.
|
|
double tmax; ///< \ru Конец области определения. \en Ending of domain.
|
|
|
|
public :
|
|
///< \ru Конструктор по значениям и параметрам. \en Constructor by values and parameters.
|
|
MbLineFunction( double v1, double v2, double t1, double t2 );
|
|
private:
|
|
MbLineFunction( const MbLineFunction & );
|
|
public :
|
|
virtual ~MbLineFunction();
|
|
public:
|
|
void Init( double v1, double v2, double t1, double t2 ); ///< \ru Инициализация по значениям и параметрам. \en Initialization by values and parameters.
|
|
public:
|
|
// \ru Общие функции математического объекта \en Common functions of mathematical object
|
|
virtual MbeFunctionType IsA() const; // \ru Тип элемента \en A type of element
|
|
virtual MbFunction & Duplicate() const; // \ru Сделать копию элемента \en Create a copy of the element
|
|
virtual bool IsSame ( const MbFunction & other, double accuracy = LENGTH_EPSILON ) const; // \ru Являются ли объекты равными \en Determine whether objects are equal
|
|
virtual bool SetEqual ( const MbFunction & ); // \ru Сделать равным \en Make equal
|
|
virtual void GetProperties( MbProperties & ); // \ru Выдать свойства объекта \en Get properties of the object
|
|
virtual void SetProperties( const MbProperties & ); // \ru Записать свойства объекта \en Set properties of the object
|
|
|
|
virtual double GetTMax() const; // \ru Вернуть максимальное значение параметра \en Get the maximum value of parameter
|
|
virtual double GetTMin() const; // \ru Вернуть минимальное значение параметра \en Get the minimum value of parameter
|
|
virtual bool IsClosed() const; // \ru Замкнутость кривой \en A curve closedness
|
|
virtual void SetClosed( bool cl ); // \ru Замкнутость функции \en A function closedness
|
|
|
|
virtual double Value ( double & t ) const; // \ru Значение функции для t \en The value of function for a given t
|
|
virtual double FirstDer ( double & t ) const; // \ru Первая производная по t \en The first derivative with respect to t
|
|
virtual double SecondDer ( double & t ) const; // \ru Вторая производная по t \en The second derivative with respect to t
|
|
virtual double ThirdDer ( double & t ) const; // \ru Третья производная по t \en The third derivative with respect to t
|
|
|
|
virtual double _Value ( double t ) const; // \ru Значение функции для t \en The value of function for a given t
|
|
virtual double _FirstDer ( double t ) const; // \ru Первая производная по t \en The first derivative with respect to t
|
|
virtual double _SecondDer ( double t ) const; // \ru Вторая производная по t \en The second derivative with respect to t
|
|
virtual double _ThirdDer ( double t ) const; // \ru Третья производная по t \en The third derivative with respect to t
|
|
// \ru Вычислить значение и производные. \en Calculate value and derivatives of object for given parameter. \~
|
|
virtual void Explore( double & t, bool ext,
|
|
double & val, double & fir, double * sec, double * thr ) const;
|
|
// \ru Вычислить аргумент t по значению функции. \en Calculate the argument t by the function value.
|
|
virtual double Argument( double & val ) const;
|
|
|
|
virtual void Inverse( MbRegTransform * iReg = NULL ); // \ru Изменить направление \en Change direction
|
|
virtual double Step( double t, double sag ) const;
|
|
virtual double DeviationStep( double t, double angle ) const;
|
|
|
|
virtual double MinValue ( double & t ) const; // \ru Минимальное значение функции \en The minimum value of function
|
|
virtual double MaxValue ( double & t ) const; // \ru Максимальное значение функции \en The maximum value of function
|
|
virtual double MidValue () const; // \ru Среднее значение функции \en The middle value of function
|
|
virtual bool IsGood () const; // \ru Корректность функции \en Correctness of function
|
|
|
|
virtual bool IsConst() const;
|
|
virtual bool IsLine () const;
|
|
|
|
// \ru Создать функцию из части функции между параметрами t1 и t2 c выбором направления sense. \en Create a function in part of the function between the parameters t1 and t2 choosing the direction.
|
|
virtual MbFunction * Trimmed( double t1, double t2, int sense ) const;
|
|
// \ru Разбить функцию точкой с параметром t и вернуть отрезанную часть. \en Function break by the parameter t, and cut off part of the function: begs == true - save the initial half, beg == false - save the final half.
|
|
virtual MbFunction * BreakFunction( double t, bool beg );
|
|
|
|
virtual void SetOffsetFunc( double distOld, double distNew ); // \ru Сместить функцию \en Shift a function
|
|
virtual bool SetLimitParam( double newTMin, double newTMax ); // \ru Установить область изменения параметра \en Set range of parameter
|
|
virtual void SetLimitValue( size_t n, double newValue ); // \ru Установить значение на конце ( 1 - в начале, 2 - в конце) \en Set the value at the end (1 - at beginning, 2 - at ending)
|
|
virtual double GetLimitValue( size_t n ) const; // \ru Дать значение на конце ( 1 - в начале, 2 - в конце) \en Get the value at the end (1 - at beginning, 2 - at ending)
|
|
|
|
private:
|
|
void operator = ( const MbLineFunction & ); // \ru Не реализовано \en Not implemented
|
|
|
|
DECLARE_PERSISTENT_CLASS_NEW_DEL( MbLineFunction )
|
|
};
|
|
|
|
IMPL_PERSISTENT_OPS( MbLineFunction )
|
|
|
|
|
|
#endif // __FUNC_LINE_FUNCTION_H
|