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
00028 #include "Quantity/Variable.h"
00029 #include "Quantity/Constant.h"
00030 #include "Quantity/QuantityCluster.h"
00031
00032 namespace quantity {
00033 namespace planeAngle {
00034
00036 class Class;
00037
00039 class Unit;
00040
00041
00042 class RadianUnits;
00043 class DegreeUnit;
00044 class MinuteUnit;
00045 class SecondUnit;
00046 class GradeUnit;
00047
00049 typedef unit::Prefixable<Unit, RadianUnits> Radians;
00050
00052 typedef unit::Prefixed<Radians> Radian;
00053 typedef unit::Prefixed<Radians, unit::Deci> DeciRadian;
00054 typedef unit::Prefixed<Radians, unit::Milli> MilliRadian;
00055 typedef unit::Prefixed<Radians, unit::Micro> MicroRadian;
00056 typedef unit::Prefixed<Radians, unit::Nano> NanoRadian;
00057 typedef unit::Prefixed<Radians, unit::Pico> PicoRadian;
00058
00060 typedef unit::NonPrefixable<Unit, DegreeUnit> Degree;
00061
00063 typedef unit::NonPrefixable<Unit, MinuteUnit> Minute;
00064
00066 typedef unit::NonPrefixable<Unit, SecondUnit> Second;
00067
00069 typedef unit::NonPrefixable<Unit, GradeUnit> Grade;
00070
00072 typedef Loki::TL::Append<Radians::Units,
00073 LOKI_TYPELIST_4(Degree, Minute, Second, Grade)>::Result Units;
00074
00075
00076 typedef quantity::Quantity<Class> Quantity;
00077 typedef quantity::Quantity<Class, int> IntQuantity;
00078
00079 class DerivedPlaneAngle;
00080
00081 }
00082
00084
00086 template<typename ST>
00087 struct Standard<planeAngle::Radians, ST>
00088 {
00089 static const ST ratio;
00090 static const bool exact;
00091 };
00092
00094 template<typename ST> const ST Standard<planeAngle::Radians, ST>::ratio = 1.0;
00095
00097 template<typename ST> const bool Standard<planeAngle::Radians, ST>::exact = true;
00098
00100
00102 template<typename ST>
00103 struct Standard<planeAngle::Degree, ST>
00104 {
00105 static const ST ratio;
00106 static const bool exact;
00107 };
00108
00110 template<typename ST> const ST Standard<planeAngle::Degree, ST>::ratio = (4. * std::atan (1.0))/180.;
00111
00113 template<typename ST> const bool Standard<planeAngle::Degree, ST>::exact = true;
00114
00116
00118 template<typename ST>
00119 struct Standard<planeAngle::Minute, ST>
00120 {
00121 static const ST ratio;
00122 static const bool exact;
00123 };
00124
00126 template<typename ST> const ST Standard<planeAngle::Minute, ST>::ratio
00127 = (4. * std::atan (1.0))/10800.;
00128
00130 template<typename ST> const bool Standard<planeAngle::Minute, ST>::exact = true;
00131
00133
00135 template<typename ST>
00136 struct Standard<planeAngle::Second, ST>
00137 {
00138 static const ST ratio;
00139 static const bool exact;
00140 };
00141
00143 template<typename ST> const ST Standard<planeAngle::Second, ST>::ratio
00144 = (4. * std::atan (1.0))/648000.;
00145
00147 template<typename ST> const bool Standard<planeAngle::Second, ST>::exact = true;
00148
00150
00152 template<typename ST>
00153 struct Standard<planeAngle::Grade, ST>
00154 {
00155 static const ST ratio;
00156 static const bool exact;
00157 };
00158
00160 template<typename ST> const ST Standard<planeAngle::Grade, ST>::ratio
00161 = (4. * std::atan (1.0))/200.;
00162
00164 template<typename ST> const bool Standard<planeAngle::Grade, ST>::exact = true;
00165
00167 template<>
00168 struct QuantityTraits<planeAngle::Class>
00169 {
00170 typedef
00171 dimension::Dimension<BSUtilities::Rational<0>,
00172 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00173 BSUtilities::Rational<0>, BSUtilities::Rational<0>,
00174 BSUtilities::Rational<0>, BSUtilities::Rational<0> > Dimension;
00175 typedef planeAngle::Unit UnitType;
00176 typedef planeAngle::Units UnitList;
00177 typedef planeAngle::Radian DefaultUnit;
00178
00179 typedef planeAngle::DerivedPlaneAngle DefaultDerivedQuantityType;
00180
00181 static const std::string NameString;
00182 static const std::string SymbolString;
00183
00184 };
00185
00186
00187 template<>
00188 struct DerivedQuantityTraits<planeAngle::Class, planeAngle::DerivedPlaneAngle>
00189 {
00190 static const bool OverwriteName = false;
00191 static const bool OverwriteSymbol = false;
00192
00193 static const std::string NameString;
00194 static const std::string SymbolString;
00195
00196 };
00197
00199
00203 #define PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(helper) template<class ST> struct helper<planeAngle::Class, ST> {static ST exec (const Quantity<planeAngle::Class, ST> &quantity) {return ST(std::sin (Reverse<planeAngle::Radian>::VAL (quantity.standard_value ())));}};
00204
00205 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(sinHelper)
00206 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(cosHelper)
00207 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(tanHelper)
00208 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(sinhHelper)
00209 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(coshHelper)
00210 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(tanhHelper)
00211 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(asinHelper)
00212 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(acosHelper)
00213 PHYSICALQUANTITIES_PLANEANGLE_TRIGONOMETRY_HELPER(atanHelper)
00214
00216 typedef Variable<planeAngle::Quantity> PlaneAngle;
00217
00219 typedef Variable<planeAngle::IntQuantity> IntPlaneAngle;
00220
00222 typedef Variable<planeAngle::Quantity> DegreePlaneAngle;
00223
00225 typedef Constant<planeAngle::Quantity> PlaneAngleConstant;
00226
00228 typedef QuantityVector<Variable, planeAngle::Quantity> PlaneAngleVector;
00229
00230 }
00231
00232 #endif