00001
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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 quantity {
00032 namespace planeAngle {
00033
00034
00035 typedef BSUtilities::Rational<0> LE;
00036 typedef BSUtilities::Rational<0> M;
00037 typedef BSUtilities::Rational<0> TI;
00038 typedef BSUtilities::Rational<0> E;
00039 typedef BSUtilities::Rational<0> TE;
00040 typedef BSUtilities::Rational<0> A;
00041 typedef BSUtilities::Rational<0> LU;
00042
00043 typedef dimension::Dimension<LE, M, TI, E, TE, A, LU> Dimension;
00044
00046 class Unit;
00047
00048
00049 class RadianUnits;
00050 class DegreeUnit;
00051 class MinuteUnit;
00052 class SecondUnit;
00053 class GradeUnit;
00054
00055
00056
00057 typedef unit::Prefixable<Unit, RadianUnits> Radians;
00058
00059 typedef unit::Prefixed<Radians> Radian;
00060 typedef unit::Prefixed<Radians, unit::Deci> DeciRadian;
00061 typedef unit::Prefixed<Radians, unit::Milli> MilliRadian;
00062 typedef unit::Prefixed<Radians, unit::Micro> MicroRadian;
00063 typedef unit::Prefixed<Radians, unit::Nano> NanoRadian;
00064 typedef unit::Prefixed<Radians, unit::Pico> PicoRadian;
00065
00066
00067
00068 typedef unit::NonPrefixable<Unit, DegreeUnit> Degree;
00069
00070
00071
00072 typedef unit::NonPrefixable<Unit, MinuteUnit> Minute;
00073
00074
00075
00076 typedef unit::NonPrefixable<Unit, SecondUnit> Second;
00077
00078
00079
00080 typedef unit::NonPrefixable<Unit, GradeUnit> Grade;
00081
00082 typedef Loki::TL::Append<Radians::Units,
00083 LOKI_TYPELIST_4(Degree, Minute, Second, Grade)>::Result Units;
00084
00085
00086
00087 typedef quantity::Quantity<Dimension, Unit, Units, Radian> Quantity;
00088 typedef quantity::Quantity<Dimension, Unit, Units, Radian, long>
00089 IntQuantity;
00090 }
00091
00092
00093
00095
00096 template<class ST>
00097 struct Sin<planeAngle::Dimension, planeAngle::Unit,
00098 planeAngle::Units, planeAngle::Radian, ST>
00099 {static ST exec (const Quantity<planeAngle::Dimension,
00100 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00101 ST> &quantity)
00102 {return ST(std::sin (Reverse<planeAngle::Radian>::VAL
00103 (quantity.standard_value ())));}
00104 };
00105
00107
00108 template<class ST>
00109 struct Cos<planeAngle::Dimension, planeAngle::Unit,
00110 planeAngle::Units, planeAngle::Radian, ST>
00111 {static ST exec (const Quantity<planeAngle::Dimension,
00112 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00113 ST> &quantity)
00114 {return ST(std::cos (Reverse<planeAngle::Radian>::VAL
00115 (quantity.standard_value ())));}
00116 };
00117
00119
00120 template<class ST>
00121 struct Tan<planeAngle::Dimension, planeAngle::Unit,
00122 planeAngle::Units, planeAngle::Radian, ST>
00123 {static ST exec (const Quantity<planeAngle::Dimension,
00124 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00125 ST> &quantity)
00126 {return ST(std::tan (Reverse<planeAngle::Radian>::VAL
00127 (quantity.standard_value ())));}
00128 };
00129
00131
00132 template<class ST>
00133 struct Sinh<planeAngle::Dimension, planeAngle::Unit,
00134 planeAngle::Units, planeAngle::Radian, ST>
00135 {static ST exec (const Quantity<planeAngle::Dimension,
00136 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00137 ST> &quantity)
00138 {return ST(std::sinh (Reverse<planeAngle::Radian>::VAL
00139 (quantity.standard_value ())));}
00140 };
00141
00143
00144 template<class ST>
00145 struct Cosh<planeAngle::Dimension, planeAngle::Unit,
00146 planeAngle::Units, planeAngle::Radian, ST>
00147 {static ST exec (const Quantity<planeAngle::Dimension,
00148 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00149 ST> &quantity)
00150 {return ST(std::cosh (Reverse<planeAngle::Radian>::VAL
00151 (quantity.standard_value ())));}
00152 };
00153
00155
00156 template<class ST>
00157 struct Tanh<planeAngle::Dimension, planeAngle::Unit,
00158 planeAngle::Units, planeAngle::Radian, ST>
00159 {static ST exec (const Quantity<planeAngle::Dimension,
00160 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00161 ST> &quantity)
00162 {return ST(std::tanh (Reverse<planeAngle::Radian>::VAL
00163 (quantity.standard_value ())));}
00164 };
00165
00167
00168 template<class ST>
00169 struct Asin<planeAngle::Dimension, planeAngle::Unit,
00170 planeAngle::Units, planeAngle::Radian, ST>
00171 {static ST exec (const Quantity<planeAngle::Dimension,
00172 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00173 ST> &quantity)
00174 {return ST(std::asin (Reverse<planeAngle::Radian>::VAL
00175 (quantity.standard_value ())));}
00176 };
00177
00179
00180 template<class ST>
00181 struct Acos<planeAngle::Dimension, planeAngle::Unit,
00182 planeAngle::Units, planeAngle::Radian, ST>
00183 {static ST exec (const Quantity<planeAngle::Dimension,
00184 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00185 ST> &quantity)
00186 {return ST(std::cos (Reverse<planeAngle::Radian>::VAL
00187 (quantity.standard_value ())));}
00188 };
00189
00191
00192 template<class ST>
00193 struct Atan<planeAngle::Dimension, planeAngle::Unit,
00194 planeAngle::Units, planeAngle::Radian, ST>
00195 {static ST exec (const Quantity<planeAngle::Dimension,
00196 planeAngle::Unit, planeAngle::Units, planeAngle::Radian,
00197 ST> &quantity)
00198 {return ST(std::atan (Reverse<planeAngle::Radian>::VAL
00199 (quantity.standard_value ())));}
00200 };
00201
00202 typedef Variable<planeAngle::Quantity> PlaneAngle;
00203 typedef Variable<planeAngle::IntQuantity> IntPlaneAngle;
00204 typedef Variable<planeAngle::Quantity, planeAngle::Degree>
00205 DegreePlaneAngle;
00206 typedef Constant<planeAngle::Quantity> PlaneAngleConstant;
00207
00208 typedef QuantityVector<Variable, planeAngle::Quantity> PlaneAngleVector;
00209
00210 }
00211
00212 #endif