💿🐜 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.

72 lines
2.1 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. * Boltzmann constant (k), in joule per kelvin.
  26. *
  27. * @see https://physics.nist.gov/cgi-bin/cuu/Value?k|search_for=universal_in!
  28. */
  29. template <class T>
  30. constexpr T boltzmann = T(1.380649e-23);
  31. /**
  32. * Gravitational constant (G), in cubic meter per second squared per kilogram.
  33. *
  34. * @see https://physics.nist.gov/cgi-bin/cuu/Value?G|search_for=universal_in!
  35. */
  36. template <class T>
  37. constexpr T gravitational = T(6.67430e-11);
  38. /**
  39. * Planck constant (h), in joule per hertz.
  40. *
  41. * @see https://physics.nist.gov/cgi-bin/cuu/Value?h|search_for=universal_in!
  42. */
  43. template <class T>
  44. constexpr T planck = T(6.62607015e-34);
  45. /**
  46. * Stefan-Boltzmann constant (sigma), in watt per square meter kelvin to the fourth.
  47. *
  48. * @see https://en.wikipedia.org/wiki/Stefan%E2%80%93Boltzmann_constant
  49. */
  50. template <class T>
  51. constexpr T stefan_boltzmann = T(5.67037441918442945397099673188923087584012297029130e-8);
  52. /**
  53. * Speed of light in vacuum (c), in meters per second.
  54. *
  55. * @see https://physics.nist.gov/cgi-bin/cuu/Value?c|search_for=universal_in!
  56. */
  57. template <class T>
  58. constexpr T speed_of_light = T(299792458);
  59. } // namespace constant
  60. } // namespace physics
  61. #endif // ANTKEEPER_PHYSICS_CONSTANTS_HPP