mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
Move Math constants into class (to be consistent with other constants), tested against minGW / gcc 4.7.2 and fixed various issues (mainly initializer lists, unused variables). BlackMisc compiles now in MinGW, but still issues (especially with qDebug() friend methods)
This commit is contained in:
@@ -12,14 +12,6 @@ namespace BlackMisc
|
||||
namespace Math
|
||||
{
|
||||
|
||||
// Some namespace wide constant values
|
||||
|
||||
//! Mathematical constant Pi
|
||||
const double PI = 4.0 * qAtan(1.0);
|
||||
|
||||
//! 2 * Pi
|
||||
const double TwoPI = 2.0 * PI;
|
||||
|
||||
/*!
|
||||
* \brief Math utils
|
||||
*/
|
||||
@@ -78,6 +70,26 @@ public:
|
||||
*/
|
||||
static double roundEpsilon(double value, double epsilon);
|
||||
|
||||
/*!
|
||||
* \brief PI
|
||||
* \return
|
||||
*/
|
||||
static const double &PI()
|
||||
{
|
||||
static double pi = 4.0 * qAtan(1.0);
|
||||
return pi;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief PI * 2
|
||||
* \return
|
||||
*/
|
||||
static const double &PI2()
|
||||
{
|
||||
static double pi2 = PI();
|
||||
return pi2;
|
||||
}
|
||||
|
||||
private:
|
||||
/*!
|
||||
* \brief Avoid object init
|
||||
|
||||
Reference in New Issue
Block a user