2015-04-01 20:21:24 +02:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) 2013 Digia Plc.
|
|
|
|
** Contact: http://www.qt-project.org/legal
|
|
|
|
**
|
|
|
|
** $QT_BEGIN_LICENSE:GPL$
|
|
|
|
**
|
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3.0 as published by the Free Software
|
|
|
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
|
|
|
** packaging of this file. Please review the following information to
|
|
|
|
** ensure the GNU General Public License version 3.0 requirements will be
|
|
|
|
** met: http://www.gnu.org/copyleft/gpl.html.
|
|
|
|
**
|
|
|
|
**
|
|
|
|
** $QT_END_LICENSE$
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2016-08-16 18:57:32 +02:00
|
|
|
#ifndef VMATH_H
|
|
|
|
#define VMATH_H
|
2015-04-01 20:21:24 +02:00
|
|
|
|
2016-08-16 18:57:32 +02:00
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 1, 0)
|
|
|
|
#include <QtMath>
|
|
|
|
#else
|
2016-08-21 10:09:49 +02:00
|
|
|
#include "qmath.h"
|
2015-04-01 20:21:24 +02:00
|
|
|
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
|
|
|
|
|
|
|
|
#endif // VMATH_H
|
|
|
|
|