💿🐜 Antkeeper source code https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.3 KiB

  1. /*
  2. * Copyright (C) 2021 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_PHYSICS_CONSTANTS_HPP
  20. #define ANTKEEPER_PHYSICS_CONSTANTS_HPP
  21. namespace physics {
  22. /// Physical constants
  23. namespace constants {
  24. /**
  25. * Avogadro number (N).
  26. *
  27. * @see https://physics.nist.gov/cgi-bin/cuu/Value?na
  28. */
  29. template <class T>
  30. constexpr T avogadro = T(6.02214076e+23);
  31. /**
  32. * Boltzmann constant (k), in joule per kelvin.
  33. *
  34. * @see https://physics.nist.gov/cgi-bin/cuu/Value?k
  35. */
  36. template <class T>
  37. constexpr T boltzmann = T(1.380649e-23);
  38. /**
  39. * Molar gas constant (R), in joule per kelvin per mole.
  40. *
  41. * @see https://en.wikipedia.org/wiki/Gas_constant
  42. */
  43. template <class T>
  44. constexpr T gas = T(8.31446261815324);
  45. /**
  46. * Gravitational constant (G), in cubic meter per second squared per kilogram.
  47. *
  48. * @see https://physics.nist.gov/cgi-bin/cuu/Value?G
  49. */
  50. template <class T>
  51. constexpr T gravitational = T(6.67430e-11);
  52. /**
  53. * Planck constant (h), in joule per hertz.
  54. *
  55. * @see https://physics.nist.gov/cgi-bin/cuu/Value?h
  56. */
  57. template <class T>
  58. constexpr T planck = T(6.62607015e-34);
  59. /**
  60. * Stefan-Boltzmann constant (sigma), in watt per square meter kelvin to the fourth.
  61. *
  62. * @see https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_constant
  63. */
  64. template <class T>
  65. constexpr T stefan_boltzmann = T(5.67037441918442945397099673188923087584012297029130e-8);
  66. /**
  67. * Speed of light in vacuum (c), in meters per second.
  68. *
  69. * @see https://physics.nist.gov/cgi-bin/cuu/Value?c
  70. */
  71. template <class T>
  72. constexpr T speed_of_light = T(299792458);
  73. } // namespace constants
  74. } // namespace physics
  75. #endif // ANTKEEPER_PHYSICS_CONSTANTS_HPP