1 #ifndef __MATHEXTRA_H__
2 #define __MATHEXTRA_H__
6 #define ARAD 57.29577951308232
7 #define RS_TOLERANCE 1.0e-10
8 #define RS_TOLERANCE_ANGLE 1.0e-8
16 static int round(double v);
17 static double pow(double x, double y);
18 static double rad2deg(double a);
19 static double deg2rad(double a);
20 static double rad2gra(double a);
21 static int findGCD(int a, int b);
22 static bool isAngleBetween(double a, double a1, double a2, bool reversed);
23 static double correctAngle(double a);
24 static double getAngleDifference(double a1, double a2);
25 static double makeAngleReadable(double angle, bool readable = true, bool * corrected = NULL);
26 static bool isAngleReadable(double angle);
27 static bool isSameDirection(double dir1, double dir2, double tol);
28 static double eval(const QString & expr, double def = 0.0);
29 static bool cmpDouble(double v1, double v2, double tol = 0.001);
30 static double eval(const QString & expr, bool * ok);
31 static QString doubleToString(double value, double prec);
32 static QString doubleToString(double value, int prec);
37 #endif // __MATHEXTRA_H__