Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 18, 2010, 9:46:16 PM (14 years ago)
Author:
rgrieder
Message:

Replaced mathematical constants with a common definition in Math.h.
Use math::pi, math::pi_d (double), math::e, etc. from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/util/Math.h

    r6502 r7184  
    5959namespace orxonox
    6060{
     61    // C++ doesn't define any constants for pi, e, etc.
     62    namespace math
     63    {
     64        const float pi      = 3.14159265f;
     65        const float pi_2    = 1.57079633f;
     66        const float pi_4    = 7.85398163e-1f;
     67        const float e       = 2.71828183f;
     68        const float sqrt2   = 1.41421356f;
     69        const float sqrt2_2 = 7.07106781e-1f;
     70
     71        const double pi_d      = 3.14159265358979324;
     72        const double pi_2_d    = 1.57079632679489662;
     73        const double pi_4_d    = 7.85398163397448310e-1;
     74        const double e_d       = 2.71828182845904524;
     75        const double sqrt2_d   = 1.41421356237309505;
     76        const double sqrt2_2_d = 7.07106781186547524e-1;
     77    }
     78
    6179#if OGRE_VERSION < 0x010603
    6280    _UtilExport std::ostream& operator<<(std::ostream& out, const orxonox::Radian& radian);
Note: See TracChangeset for help on using the changeset viewer.