13 #include "qwt_global.h" 23 #define _USE_MATH_DEFINES 1 27 #include "qwt_global.h" 32 #define M_PI_2 (1.57079632679489661923) 36 #define LOG_MIN 1.0e-100 41 #define LOG_MAX 1.0e100 45 QWT_EXPORT
double qwtGetMin(
const double *array,
int size );
46 QWT_EXPORT
double qwtGetMax(
const double *array,
int size );
48 QWT_EXPORT
double qwtNormalizeRadians(
double radians );
49 QWT_EXPORT
double qwtNormalizeDegrees(
double degrees );
63 inline int qwtFuzzyCompare(
double value1,
double value2,
double intervalSize )
65 const double eps = qAbs( 1.0e-6 * intervalSize );
67 if ( value2 - value1 > eps )
70 if ( value1 - value2 > eps )
77 inline bool qwtFuzzyGreaterOrEqual(
double d1,
double d2 )
79 return ( d1 >= d2 ) || qFuzzyCompare( d1, d2 );
82 inline bool qwtFuzzyLessOrEqual(
double d1,
double d2 )
84 return ( d1 <= d2 ) || qFuzzyCompare( d1, d2 );
88 inline int qwtSign(
double x )
99 inline double qwtSqr(
double x )
105 inline double qwtFastAtan(
double x )
108 return -M_PI_2 - x / ( x * x + 0.28 );
111 return M_PI_2 - x / ( x * x + 0.28 );
113 return x / ( 1.0 + x * x * 0.28 );
117 inline double qwtFastAtan2(
double y,
double x )
120 return qwtFastAtan( y / x );
124 const double d = qwtFastAtan( y / x );
125 return ( y >= 0 ) ? d + M_PI : d - M_PI;
138 inline double qwtRadians(
double degrees )
140 return degrees * M_PI / 180.0;
144 inline double qwtDegrees(
double degrees )
146 return degrees * 180.0 / M_PI;