universal_constants.hpp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Boost.Units - A C++ library for zero-overhead dimensional analysis and
  2. // unit/quantity manipulation and conversion
  3. //
  4. // Copyright (C) 2003-2008 Matthias Christian Schabel
  5. // Copyright (C) 2008 Steven Watanabe
  6. //
  7. // Distributed under the Boost Software License, Version 1.0. (See
  8. // accompanying file LICENSE_1_0.txt or copy at
  9. // http://www.boost.org/LICENSE_1_0.txt)
  10. #ifndef BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP
  11. #define BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP
  12. #include <boost/units/quantity.hpp>
  13. #include <boost/units/static_constant.hpp>
  14. #include <boost/units/systems/detail/constants.hpp>
  15. #include <boost/units/systems/si/capacitance.hpp>
  16. #include <boost/units/systems/si/current.hpp>
  17. #include <boost/units/systems/si/energy.hpp>
  18. #include <boost/units/systems/si/force.hpp>
  19. #include <boost/units/systems/si/length.hpp>
  20. #include <boost/units/systems/si/mass.hpp>
  21. #include <boost/units/systems/si/resistance.hpp>
  22. #include <boost/units/systems/si/temperature.hpp>
  23. #include <boost/units/systems/si/time.hpp>
  24. #include <boost/units/systems/si/velocity.hpp>
  25. #include <boost/units/systems/si/volume.hpp>
  26. #include <boost/units/systems/si/codata/typedefs.hpp>
  27. /// \file
  28. /// CODATA recommended values of fundamental universal constants
  29. /// using CODATA 2006 values as of 2007/03/30
  30. namespace boost {
  31. namespace units {
  32. namespace si {
  33. namespace constants {
  34. namespace codata {
  35. /// CODATA recommended values of the fundamental physical constants: NIST SP 961
  36. // UNIVERSAL
  37. /// speed of light
  38. BOOST_UNITS_PHYSICAL_CONSTANT(c,quantity<velocity>,299792458.0*meters/second,0.0*meters/second);
  39. /// magnetic constant (exactly 4 pi x 10^(-7) - error is due to finite precision of pi)
  40. BOOST_UNITS_PHYSICAL_CONSTANT(mu_0,quantity<force_over_current_squared>,12.56637061435917295385057353311801153679e-7*newtons/ampere/ampere,0.0*newtons/ampere/ampere);
  41. /// electric constant
  42. BOOST_UNITS_PHYSICAL_CONSTANT(epsilon_0,quantity<capacitance_over_length>,8.854187817620389850536563031710750260608e-12*farad/meter,0.0*farad/meter);
  43. /// characteristic impedance of vacuum
  44. BOOST_UNITS_PHYSICAL_CONSTANT(Z_0,quantity<resistance>,376.7303134617706554681984004203193082686*ohm,0.0*ohm);
  45. /// Newtonian constant of gravitation
  46. BOOST_UNITS_PHYSICAL_CONSTANT(G,quantity<volume_over_mass_time_squared>,6.67428e-11*cubic_meters/kilogram/second/second,6.7e-15*cubic_meters/kilogram/second/second);
  47. /// Planck constant
  48. BOOST_UNITS_PHYSICAL_CONSTANT(h,quantity<energy_time>,6.62606896e-34*joule*seconds,3.3e-41*joule*seconds);
  49. /// Dirac constant
  50. BOOST_UNITS_PHYSICAL_CONSTANT(hbar,quantity<energy_time>,1.054571628e-34*joule*seconds,5.3e-42*joule*seconds);
  51. /// Planck mass
  52. BOOST_UNITS_PHYSICAL_CONSTANT(m_P,quantity<mass>,2.17644e-8*kilograms,1.1e-12*kilograms);
  53. /// Planck temperature
  54. BOOST_UNITS_PHYSICAL_CONSTANT(T_P,quantity<temperature>,1.416785e32*kelvin,7.1e27*kelvin);
  55. /// Planck length
  56. BOOST_UNITS_PHYSICAL_CONSTANT(l_P,quantity<length>,1.616252e-35*meters,8.1e-40*meters);
  57. /// Planck time
  58. BOOST_UNITS_PHYSICAL_CONSTANT(t_P,quantity<time>,5.39124e-44*seconds,2.7e-48*seconds);
  59. } // namespace codata
  60. } // namespace constants
  61. } // namespace si
  62. } // namespace units
  63. } // namespace boost
  64. #endif // BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP