Warning, /include/Geant4/tools/mathd is written in an unsupported language. File is not indexed.
0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003
0004 #ifndef tools_mathd
0005 #define tools_mathd
0006
0007 namespace tools {
0008
0009 //have : static const pi = 3.1415926535897931160E0; ???
0010
0011 //HEALPix lsconstants.h. Quite not the same as us.
0012 //const double pi=3.141592653589793238462643383279502884197;
0013 //const double twopi=6.283185307179586476925286766559005768394;
0014 //const double fourpi=12.56637061435917295385057353311801153679;
0015 //const double halfpi=1.570796326794896619231321691639751442099;
0016
0017 inline double pi() {return 3.1415926535897931160E0;}
0018 inline double two_pi() {return 6.2831853071795862320E0;}
0019 inline double half_pi() {return 1.5707963267948965580E0;}
0020
0021 inline double deg2rad() {
0022 static const double s_v = pi()/180.0;
0023 return s_v;
0024 }
0025 inline double rad2deg() {
0026 static const double s_v = 180.0/pi();
0027 return s_v;
0028 }
0029
0030 }
0031
0032 #include <cmath>
0033
0034 namespace tools {
0035
0036 inline double dfabs(const double& a_x) {return ::fabs(a_x);} //if passing a_fabs(const T&).
0037
0038 }
0039
0040 #endif