Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members

PlaneAngle.h

Go to the documentation of this file.
00001 
00004 /* Copyright (C) 2002-2004, Bernd Speiser */
00005 
00006 /* This file is part of Quantities.
00007 
00008 PhysicalQuantities is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 PhysicalQuantities is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017   
00018 You should have received a copy of the GNU General Public License
00019 along with this program; if not, write to the Free Software
00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
00021 02111-1307, USA.
00022 */
00023 
00024 #ifndef _PlaneAngle_h
00025 #define _PlaneAngle_h
00026 
00027 #include "Quantity/Variable.h"
00028 #include "Quantity/Constant.h"
00029 #include "Quantity/QuantityCluster.h"
00030 
00031 namespace Quantities {
00032 
00033 /* PlaneAngle dimension */
00034 typedef BSUtilities::Rational<0> PlaneAngle_LE;
00035 typedef BSUtilities::Rational<0> PlaneAngle_M;
00036 typedef BSUtilities::Rational<0> PlaneAngle_TI;
00037 typedef BSUtilities::Rational<0> PlaneAngle_E;
00038 typedef BSUtilities::Rational<0> PlaneAngle_TE;
00039 typedef BSUtilities::Rational<0> PlaneAngle_A;
00040 typedef BSUtilities::Rational<0> PlaneAngle_LU;
00041 
00042 class PlaneAngleGroup
00043   {
00044     public:
00045       typedef TYPELIST_7(PlaneAngle_LE, PlaneAngle_M, PlaneAngle_TI, 
00046                          PlaneAngle_E, PlaneAngle_TE, PlaneAngle_A, 
00047                          PlaneAngle_LU) DimTL;
00048   };
00049 
00050   namespace PlaneAngleUnits {
00051 
00052 /* declaration of PlaneAngle unit base class */
00053 typedef Units::Unit<PlaneAngleGroup> PlaneAngleUnit;
00054 
00055 /* declaration of PlaneAngle units */
00056 class RadianUnits;
00057 class DegreeUnit;
00058 class MinuteUnit;
00059 class SecondUnit;
00060 class GradeUnit;
00061 
00062 /* the radian and prefixed radians */
00063 
00064 typedef Units::Prefixable<PlaneAngleGroup, RadianUnits> Radians;
00065 
00066 typedef Units::Prefixed<Radians> Radian;
00067 typedef Units::Prefixed<Radians, Units::Deci> DeciRadian;
00068 typedef Units::Prefixed<Radians, Units::Milli> MilliRadian;
00069 typedef Units::Prefixed<Radians, Units::Micro> MicroRadian;
00070 typedef Units::Prefixed<Radians, Units::Nano> NanoRadian;
00071 typedef Units::Prefixed<Radians, Units::Pico> PicoRadian;
00072 
00073 /* the degree */
00074 
00075 typedef Units::NonPrefixable<PlaneAngleGroup, DegreeUnit> Degree;
00076 
00077 /* the minute */
00078 
00079 typedef Units::NonPrefixable<PlaneAngleGroup, MinuteUnit> Minute;
00080 
00081 /* the second */
00082 
00083 typedef Units::NonPrefixable<PlaneAngleGroup, SecondUnit> Second;
00084 
00085 /* the grade */
00086 
00087 typedef Units::NonPrefixable<PlaneAngleGroup, GradeUnit> Grade;
00088 
00089 typedef Loki::TL::Append<Radians::Units,
00090      TYPELIST_4(Degree, Minute, Second, Grade)>::Result PlaneAngleUnits;
00091 
00092   }
00093 
00094 /* declaration of PlaneAngle dimension */
00095 
00096 typedef Dimensions::Dimension<PlaneAngleGroup> PlaneAngleDimension;
00097 
00098 /* PlaneAngle quantity */
00099 
00100 typedef Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits,
00101                           PlaneAngleUnits::Radian> PlaneAngleQuantities;
00102 
00103 typedef Variable<PlaneAngleQuantities> PlaneAngle;
00104 typedef Variable<PlaneAngleQuantities, PlaneAngleUnits::Degree> 
00105                                                        DegreePlaneAngle;
00106 typedef Constant<PlaneAngleQuantities> PlaneAngleConstant;
00107 
00108 typedef VariableVector<PlaneAngleQuantities> PlaneAngleVector;
00109 
00110 /* specializations of trigonometric functions; add similar set
00111    for any ST! */
00112 
00114 
00115   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00116                                    PlaneAngleUnits::Radian, double>::Sin
00117     {static double exec (const Quantity<PlaneAngleGroup, 
00118        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00119                                                       double> &quantity)
00120       {return double(std::sin (PlaneAngleUnits::Radian::Reverse
00121                                         (quantity.standard_value ())));}
00122     };
00123 
00125 
00126 template<>
00127   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00128                                    PlaneAngleUnits::Radian, double>::Cos
00129     {static double exec (const Quantity<PlaneAngleGroup, 
00130        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00131                                                       double> &quantity)
00132       {return double(std::cos (PlaneAngleUnits::Radian::Reverse
00133                                         (quantity.standard_value ())));}
00134     };
00135 
00137 
00138 template<>
00139   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00140                                    PlaneAngleUnits::Radian, double>::Tan
00141     {static double exec (const Quantity<PlaneAngleGroup, 
00142        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00143                                                       double> &quantity)
00144       {return double(std::tan (PlaneAngleUnits::Radian::Reverse
00145                                         (quantity.standard_value ())));}
00146     };
00147 
00149 
00150 template<>
00151   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00152                                   PlaneAngleUnits::Radian, double>::Sinh
00153     {static double exec (const Quantity<PlaneAngleGroup, 
00154        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00155                                                       double> &quantity)
00156       {return double(std::sinh (PlaneAngleUnits::Radian::Reverse
00157                                         (quantity.standard_value ())));}
00158     };
00159 
00161 
00162 template<>
00163   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00164                                   PlaneAngleUnits::Radian, double>::Cosh
00165     {static double exec (const Quantity<PlaneAngleGroup, 
00166        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00167                                                       double> &quantity)
00168       {return double(std::cosh (PlaneAngleUnits::Radian::Reverse
00169                                         (quantity.standard_value ())));}
00170     };
00171 
00173 
00174 template<>
00175   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00176                                   PlaneAngleUnits::Radian, double>::Tanh
00177     {static double exec (const Quantity<PlaneAngleGroup, 
00178        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00179                                                       double> &quantity)
00180       {return double(std::tanh (PlaneAngleUnits::Radian::Reverse
00181                                         (quantity.standard_value ())));}
00182     };
00183 
00185 
00186 template<>
00187   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00188                                   PlaneAngleUnits::Radian, double>::Asin
00189     {static double exec (const Quantity<PlaneAngleGroup, 
00190        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00191                                                       double> &quantity)
00192       {return double(std::asin (PlaneAngleUnits::Radian::Reverse
00193                                         (quantity.standard_value ())));}
00194     };
00195 
00197 
00198 template<>
00199   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00200                                   PlaneAngleUnits::Radian, double>::Acos
00201     {static double exec (const Quantity<PlaneAngleGroup, 
00202        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00203                                                       double> &quantity)
00204       {return double(std::cos (PlaneAngleUnits::Radian::Reverse
00205                                         (quantity.standard_value ())));}
00206     };
00207 
00209 
00210 template<>
00211   struct Quantity<PlaneAngleGroup, PlaneAngleUnits::PlaneAngleUnits, 
00212                                   PlaneAngleUnits::Radian, double>::Atan
00213     {static double exec (const Quantity<PlaneAngleGroup, 
00214        PlaneAngleUnits::PlaneAngleUnits, PlaneAngleUnits::Radian, 
00215                                                       double> &quantity)
00216       {return double(std::atan (PlaneAngleUnits::Radian::Reverse
00217                                         (quantity.standard_value ())));}
00218     };
00219 
00220 }
00221 
00222 #endif /* _PlaneAngle_h */

Generated on Sun Jan 15 13:58:03 2006 for PhysicalQuantities by doxygen 1.3.6