diff options
Diffstat (limited to 'src/corelib/kernel/qmath.h')
-rw-r--r-- | src/corelib/kernel/qmath.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/corelib/kernel/qmath.h b/src/corelib/kernel/qmath.h index 75ec55f845..21e23b9eb0 100644 --- a/src/corelib/kernel/qmath.h +++ b/src/corelib/kernel/qmath.h @@ -266,6 +266,26 @@ inline qreal qFastCos(qreal x) return qt_sine_table[si] - (qt_sine_table[ci] + 0.5 * qt_sine_table[si] * d) * d; } +Q_DECL_CONSTEXPR inline float qDegreesToRadians(float degrees) +{ + return degrees * float(M_PI/180); +} + +Q_DECL_CONSTEXPR inline double qDegreesToRadians(double degrees) +{ + return degrees * (M_PI / 180); +} + +Q_DECL_CONSTEXPR inline float qRadiansToDegrees(float radians) +{ + return radians * float(180/M_PI); +} + +Q_DECL_CONSTEXPR inline double qRadiansToDegrees(double radians) +{ + return radians * (180 / M_PI); +} + QT_END_NAMESPACE #endif // QMATH_H |