Constants.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2004 CSIRO ICT Centre
00003  *
00004  * $Id: Constants.h 1161 2005-09-12 17:52:16Z rsc $
00005  */
00006 
00007 #ifndef CONSTANTS_DEFINED
00008 #define CONSTANTS_DEFINED
00009 
00010 #include <cmath>
00011 
00012 class Constants
00013 {
00014   public:
00015     static const long double s_pi;
00016     static const long double s_raddeg;
00017     static const long double s_degrad;
00018     static const long double s_minutes;
00019 
00020     // Trig functions where the angles used are in degrees.
00021     // Not really constants, but oh well...
00022     static double sinDeg(double x)  { return std::sin(x * Constants::s_raddeg); }
00023     static double cosDeg(double x)  { return std::cos(x * Constants::s_raddeg); }
00024     static double asinDeg(double x) { return std::asin(x) * Constants::s_degrad; }
00025     static double acosDeg(double x) { return std::acos(x) * Constants::s_degrad; }
00026 
00027     // degree<->arcminutes convertors
00028     static double degToArcmin(double aDeg)
00029     {
00030       return aDeg * Constants::s_minutes;
00031     }
00032     static double arcminToDeg(double aArcmin)
00033     {
00034       return aArcmin / Constants::s_minutes;
00035     }
00036 
00037   private:
00038     Constants() {};
00039     ~Constants() {};
00040     Constants(Constants const &);
00041     Constants & operator=(Constants const &);
00042 };
00043 
00044 #endif // ifndef CONSTANTS_DEFINED
Generated on Mon Oct 4 10:39:55 2010 for Matching.kdevelop by  doxygen 1.6.3