00001 00008 /* Copyright (C) 2002 - 2010, Bernd Speiser */ 00009 00010 /* This file is part of PhysicalQuantities. 00011 00012 PhysicalQuantities is free software; you can redistribute it and/or 00013 modify it under the terms of the GNU General Public License 00014 as published by the Free Software Foundation; either version 2 00015 of the License, or (at your option) any later version. 00016 00017 PhysicalQuantities is distributed in the hope that it will be useful, 00018 but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 GNU General Public License for more details. 00021 00022 You should have received a copy of the GNU General Public License 00023 along with this program; if not, write to the Free Software 00024 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00025 02111-1307, USA. 00026 */ 00027 00028 #ifndef _Length_cc 00029 #define _Length_cc 00030 00031 // Quantity includes 00032 #include "Quantities/PhysicalQuantities/Length.h" 00033 00034 namespace quantity { 00035 namespace length { 00036 00037 /* definition of Length units */ 00038 /* the metre and prefixed metres */ 00039 00040 template<> const std::string Metres::Basename = "metre"; 00041 template<> const std::string Metres::Basesymbol = "m"; 00042 template<> const bool Metres::SI = true; 00043 template<> const bool Metres::Exact = true; 00044 template<> const double Metres::StandardFactor = 1.0; 00045 00046 /* the Bohr */ 00047 00048 template<> const std::string Bohr::Namestring = "bohr"; 00049 template<> const std::string Bohr::Symbolstring = "b"; 00050 template<> const bool Bohr::SI = false; 00051 template<> const bool Bohr::Exact = false; 00052 template<> const double Bohr::StandardFactor = 5.29177e-11; 00053 00054 /* the Angstrom */ 00055 00056 template<> const std::string Angstrom::Namestring = "angstrom"; 00057 template<> const std::string Angstrom::Symbolstring = "A0"; 00058 template<> const bool Angstrom::SI = false; 00059 template<> const bool Angstrom::Exact = true; 00060 template<> const double Angstrom::StandardFactor = 1.0e-10; 00061 00062 /* the micron */ 00063 00064 template<> const std::string Micron::Namestring = "micron"; 00065 template<> const std::string Micron::Symbolstring = "mu"; 00066 template<> const bool Micron::SI = false; 00067 template<> const bool Micron::Exact = true; 00068 template<> const double Micron::StandardFactor = 1.0e-6; 00069 00070 /* the millimicron */ 00071 00072 template<> const std::string MilliMicron::Namestring = "millimicron"; 00073 template<> const std::string MilliMicron::Symbolstring = "mmu"; 00074 template<> const bool MilliMicron::SI = false; 00075 template<> const bool MilliMicron::Exact = true; 00076 template<> const double MilliMicron::StandardFactor = 1.0-9; 00077 00078 /* the X */ 00079 00080 template<> const std::string X::Namestring = "xunit"; 00081 template<> const std::string X::Symbolstring = "X"; 00082 template<> const bool X::SI = false; 00083 template<> const bool X::Exact = false; 00084 template<> const double X::StandardFactor = 1.002e-13; 00085 00086 /* the Fermi */ 00087 00088 template<> const std::string Fermi::Namestring = "fermi"; 00089 template<> const std::string Fermi::Symbolstring = "f"; 00090 template<> const bool Fermi::SI = false; 00091 template<> const bool Fermi::Exact = true; 00092 template<> const double Fermi::StandardFactor = 1.0e-15; 00093 00094 /* the Inch */ 00095 00096 template<> const std::string Inch::Namestring = "inch"; 00097 template<> const std::string Inch::Symbolstring = "in"; 00098 template<> const bool Inch::SI = false; 00099 template<> const bool Inch::Exact = true; 00100 template<> const double Inch::StandardFactor = 2.54e-2; 00101 00102 /* the foot */ 00103 00104 template<> const std::string Foot::Namestring = "foot"; 00105 template<> const std::string Foot::Symbolstring = "ft"; 00106 template<> const bool Foot::SI = false; 00107 template<> const bool Foot::Exact = true; 00108 template<> const double Foot::StandardFactor = 0.3048; 00109 00110 /* the Yard */ 00111 00112 template<> const std::string Yard::Namestring = "yard"; 00113 template<> const std::string Yard::Symbolstring = "yd"; 00114 template<> const bool Yard::SI = false; 00115 template<> const bool Yard::Exact = true; 00116 template<> const double Yard::StandardFactor = 0.9144; 00117 00118 /* the Mile */ 00119 00120 template<> const std::string Mile::Namestring = "mile"; 00121 template<> const std::string Mile::Symbolstring = "mi"; 00122 template<> const bool Mile::SI = false; 00123 template<> const bool Mile::Exact = true; 00124 template<> const double Mile::StandardFactor = 1609.344; 00125 00126 /* the nautical Mile */ 00127 00128 template<> const std::string NauticalMile::Namestring = "nauticalmile"; 00129 template<> const std::string NauticalMile::Symbolstring = ""; 00130 template<> const bool NauticalMile::SI = false; 00131 template<> const bool NauticalMile::Exact = true; 00132 template<> const double NauticalMile::StandardFactor = 1852.; 00133 00134 /* the astronomical unit */ 00135 00136 template<> const std::string Astronomical::Namestring 00137 = "astronomicalunit"; 00138 template<> const std::string Astronomical::Symbolstring = "AU"; 00139 template<> const bool Astronomical::SI = false; 00140 template<> const bool Astronomical::Exact = true; 00141 template<> const double Astronomical::StandardFactor = 1.49600e11; 00142 00143 /* the Parsec */ 00144 00145 template<> const std::string Parsec::Namestring = "parsec"; 00146 template<> const std::string Parsec::Symbolstring = "pc"; 00147 template<> const bool Parsec::SI = false; 00148 template<> const bool Parsec::Exact = false; 00149 template<> const double Parsec::StandardFactor = 3.08568e16; 00150 00151 /* the Lightyear */ 00152 00153 template<> const std::string LightYear::Namestring = "lightyear"; 00154 template<> const std::string LightYear::Symbolstring = "l.y."; 00155 template<> const bool LightYear::SI = false; 00156 template<> const bool LightYear::Exact = false; 00157 template<> const double LightYear::StandardFactor = 9.460528e15; 00158 00159 /* the Lightsecond */ 00160 00161 template<> const std::string LightSecond::Namestring = "lightsecond"; 00162 template<> const std::string LightSecond::Symbolstring = ""; 00163 template<> const bool LightSecond::SI = false; 00164 template<> const bool LightSecond::Exact = true; 00165 template<> const double LightSecond::StandardFactor = 299792458.; 00166 00167 } 00168 00169 const std::string QuantityTraits<length::Class>::NameString (void) 00170 {return "length";} 00171 const std::string QuantityTraits<length::Class>::SymbolString (void) 00172 {return "l";} 00173 00174 } 00175 00176 #endif /* _Length_h */