15 #include "qwt_global.h"
16 #include "qwt_double_rect.h"
18 #if QT_VERSION < 0x040000
24 #else // QT_VERSION >= 0x040000
33 #define LOG10_2 0.30102999566398119802
37 #define LOG10_3 0.47712125471966243540
41 #define LOG10_5 0.69897000433601885749
45 #define M_2PI 6.28318530717958623200
50 #define LOG_MIN 1.0e-100
55 #define LOG_MAX 1.0e100
59 #define M_E 2.7182818284590452354
63 #define M_LOG2E 1.4426950408889634074
67 #define M_LOG10E 0.43429448190325182765
71 #define M_LN2 0.69314718055994530942
75 #define M_LN10 2.30258509299404568402
79 #define M_PI 3.14159265358979323846
83 #define M_PI_2 1.57079632679489661923
87 #define M_PI_4 0.78539816339744830962
91 #define M_1_PI 0.31830988618379067154
95 #define M_2_PI 0.63661977236758134308
99 #define M_2_SQRTPI 1.12837916709551257390
103 #define M_SQRT2 1.41421356237309504880
107 #define M_SQRT1_2 0.70710678118654752440
110 QWT_EXPORT
double qwtGetMin(
const double *array,
int size);
111 QWT_EXPORT
double qwtGetMax(
const double *array,
int size);
115 inline int qwtSign(
double x)
126 inline double qwtSqr(
const double x)
138 T qwtLim(
const T& x,
const T& x1,
const T& x2)
143 xmin = qwtMin(x1, x2);
144 xmax = qwtMax(x1, x2);
156 inline QPoint qwtPolar2Pos(
const QPoint &pole,
157 double radius,
double angle)
159 const double x = pole.x() + radius * ::cos(angle);
160 const double y = pole.y() - radius * ::sin(angle);
162 return QPoint(qRound(x), qRound(y));
165 inline QPoint qwtDegree2Pos(
const QPoint &pole,
166 double radius,
double angle)
168 return qwtPolar2Pos(pole, radius, angle / 180.0 * M_PI);
171 inline QwtDoublePoint qwtPolar2Pos(
const QwtDoublePoint &pole,
172 double radius,
double angle)
174 const double x = pole.x() + radius * ::cos(angle);
175 const double y = pole.y() - radius * ::sin(angle);
177 return QPoint(qRound(x), qRound(y));
180 inline QwtDoublePoint qwtDegree2Pos(
const QwtDoublePoint &pole,
181 double radius,
double angle)
183 return qwtPolar2Pos(pole, radius, angle / 180.0 * M_PI);
187 inline double qwtRound(
double value)
189 return ::floor(value + 0.5);