00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef GMATH_HPP
00028 #define GMATH_HPP
00029
00030
00031 #include <cmath>
00032
00033
00034 namespace gammalib {
00035 const double pi = 3.141592653589793238462643383279502884197;
00036 const double twopi = 6.283185307179586476925286766559005768394;
00037 const double fourpi = 12.56637061435917295385057353311801153679;
00038 const double pihalf = 1.570796326794896619231321691639751442099;
00039 const double inv_pihalf = 0.6366197723675813430755350534900574;
00040 const double inv_sqrt4pi = 0.2820947917738781434740397257803862929220;
00041 const double inv_sqrt2pi = 0.3989422804014327028632180827116826549172;
00042 const double pi2 = pi*pi;
00043 const double deg2rad = 0.0174532925199432954743717;
00044 const double rad2deg = 57.295779513082322864647722;
00045 const double ln2 = 0.6931471805599453094172321214581766;
00046 const double ln10 = 2.3025850929940456840179914546843642;
00047 const double inv_ln2 = 1.4426950408889634073599246810018921;
00048 const double onethird = 1.0/3.0;
00049 const double twothird = 2.0/3.0;
00050 const double fourthird = 4.0/3.0;
00051 const double sqrt_onehalf = std::sqrt(1.0/2.0);
00052 const double sqrt_pihalf = std::sqrt(pihalf);
00053 const double sqrt_two = std::sqrt(2.0);
00054 const double inv_ln10 = 1.0/ln10;
00055 }
00056
00057
00058 namespace gammalib {
00059
00060
00061 double acos(const double& arg);
00062 double cosd(const double& angle);
00063 double sind(const double& angle);
00064 double tand(const double& angle);
00065 double asind(const double& value);
00066 double acosd(const double& value);
00067 double atand(const double& value);
00068 double atan2d(const double& y, const double& x);
00069 void sincosd(const double& angle, double *s, double *c);
00070
00071
00072 double gammln(const double& arg);
00073 double erfcc(const double& arg);
00074 double erfinv(const double& arg);
00075 double modulo(const double& v1, const double& v2);
00076 }
00077
00078 #endif