1
// -*- mode: C++; tab-width: 2; -*-
4
// --------------------------------------------------------------------------
5
// OpenMS Mass Spectrometry Framework
6
// --------------------------------------------------------------------------
7
// Copyright (C) 2003-2011 -- Oliver Kohlbacher, Knut Reinert
9
// This library is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU Lesser General Public
11
// License as published by the Free Software Foundation; either
12
// version 2.1 of the License, or (at your option) any later version.
14
// This library is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
// Lesser General Public License for more details.
19
// You should have received a copy of the GNU Lesser General Public
20
// License along with this library; if not, write to the Free Software
21
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
// --------------------------------------------------------------------------
24
// $Maintainer: Stephan Aiche$
25
// $Authors: Marc Sturm $
26
// --------------------------------------------------------------------------
28
#ifndef OPENMS_CONCEPT_CONSTANTS_H
29
#define OPENMS_CONCEPT_CONSTANTS_H
31
#include <OpenMS/config.h>
34
@brief Main %OpenMS namespace.
36
In this namespace all the main %OpenMS classes are located.
41
@brief Mathematical and physical constants namespace.
43
This namespace contains definitions for some basic mathematical and physical constants.
44
All constants are double precision.
46
There are basically two ways of accessing these constants:
48
<LI> specify all namespaces:
50
<tt>double my_pi = OpenMS::Constants::PI</tt>
52
<LI>shortcut via the <tt>using directive</tt>:
54
<tt>using namespace OpenMS::Constants;
56
double my_pi = PI;</tt>
63
/** @name Mathematical constants.
68
extern OPENMS_DLLAPI const double PI;
70
/// Euler's number - base of the natural logarithm
71
extern OPENMS_DLLAPI const double E;
73
/** Internal theshold for equality comparisons.
74
Default value is 1e-6.
76
extern OPENMS_DLLAPI double EPSILON;
79
/** @name Chemical/physical constants.
83
/** Elementary charge.
84
In units of C (\f$1.60217738 \cdot 10^{-19} C\f$).
86
extern OPENMS_DLLAPI const double ELEMENTARY_CHARGE; // C
88
/// Elementary charge (alias)
89
extern OPENMS_DLLAPI const double e0;
92
In units of kg (\f$9.1093897 \cdot 10^{-31}\f$ kg).
94
extern OPENMS_DLLAPI const double ELECTRON_MASS ; // kg
97
In units (\f$1,822.88850204(77)^{-1}\f$u).
99
extern OPENMS_DLLAPI const double ELECTRON_MASS_U ; // u
102
In units of kg (\f$1.6726230 \cdot 10^{-27}\f$ kg).
104
extern OPENMS_DLLAPI const double PROTON_MASS ; // kg
107
In units (\f$1.00727646677(10)\f$u)
109
extern OPENMS_DLLAPI const double PROTON_MASS_U ; // u
112
In units of kg (\f$1.6749286 \cdot 10^{-27}\f$ kg).
114
extern OPENMS_DLLAPI const double NEUTRON_MASS ; // kg
117
In units (\f$1.0086649156(6)\f$u)
119
extern OPENMS_DLLAPI const double NEUTRON_MASS_U ; // u
121
/** Avogadro constant.
122
In units of \f$mol^{-1}\f$ (\f$6.0221367 \cdot 10^{23} mol^{-1}\f$).
124
extern OPENMS_DLLAPI const double AVOGADRO;
126
/** Avogadro constant (alias)
128
extern OPENMS_DLLAPI const double NA;
130
/** Avogadro constant (alias)
132
extern OPENMS_DLLAPI const double MOL;
134
/** Boltzmann constant.
135
In units of J/K (\f$1.380657 \cdot 10^{-23}\f$ J/K).
137
extern OPENMS_DLLAPI const double BOLTZMANN;
139
/** Boltzmann constant (alias)
141
extern OPENMS_DLLAPI const double k;
144
In units of Js (\f$6.6260754 \cdot 10^{-34}\f$ Js).
146
extern OPENMS_DLLAPI const double PLANCK;
148
/** Planck constant (alias)
150
extern OPENMS_DLLAPI const double h;
152
/** Gas constant (= NA * k)
154
extern OPENMS_DLLAPI const double GAS_CONSTANT;
156
/** Gas constant (alias)
158
extern OPENMS_DLLAPI const double R;
160
/** Faraday constant (= NA * e0)
162
extern OPENMS_DLLAPI const double FARADAY;
164
/** Faraday constant (alias)
166
extern OPENMS_DLLAPI const double F;
169
In units m (\f$5.29177249 \cdot 10^{-11}\f$ m).
171
extern OPENMS_DLLAPI const double BOHR_RADIUS;
173
/** Bohr radius (alias)
175
extern OPENMS_DLLAPI const double a0;
177
// the following values from:
178
// P.W.Atkins: Physical Chemistry, 5th ed., Oxford University Press, 1995
180
/** Vacuum permittivity.
181
In units of \f$C^2J^{-1}m^{-1}\f$ (\f$8.85419 \cdot 10^{-12} C^2J^{-1}m^{-1}\f$).
183
extern OPENMS_DLLAPI const double VACUUM_PERMITTIVITY;
185
/** Vacuum permeability.
186
In units of \f$Js^2C^{-2}m^{-1}\f$ (\f$4\pi \cdot 10^{-7} Js^2C^{-2}m^{-1}\f$).
188
extern OPENMS_DLLAPI const double VACUUM_PERMEABILITY;
191
In units of m/s (\f$2.99792458 \cdot 10^8 ms^{-1}\f$).
193
extern OPENMS_DLLAPI const double SPEED_OF_LIGHT;
195
/** Speed of Light (alias)
197
extern OPENMS_DLLAPI const double c;
199
/** Gravitational constant.
200
In units of \f$Nm^2kg^{-2}\f$ (\f$6.67259 \cdot 10^{-11} Nm^2kg^{-2}\f$).
202
extern OPENMS_DLLAPI const double GRAVITATIONAL_CONSTANT;
204
/** Fine structure constant.
205
Without unit (\f$7.29735 \cdot 10^{-3}\f$).
207
extern OPENMS_DLLAPI const double FINE_STRUCTURE_CONSTANT;
210
/** @name Conversion factors
217
extern OPENMS_DLLAPI const double DEG_PER_RAD;
220
0.0174532925199432957
222
extern OPENMS_DLLAPI const double RAD_PER_DEG;
227
extern OPENMS_DLLAPI const double MM_PER_INCH ;
232
extern OPENMS_DLLAPI const double M_PER_FOOT ;
234
/** Joules per calorie.
237
extern OPENMS_DLLAPI const double JOULE_PER_CAL;
239
/** Calories per Joule.
242
extern OPENMS_DLLAPI const double CAL_PER_JOULE;
248
#endif // OPENMS_CONCEPT_CONSTANTS_H