diff --git a/src/include/units/constant.h b/src/include/units/constant.h deleted file mode 100644 index 8e97e0d7..00000000 --- a/src/include/units/constant.h +++ /dev/null @@ -1,46 +0,0 @@ - -// The MIT License (MIT) -// -// Copyright (c) 2018 Mateusz Pusz -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -#pragma once - -#include - - -namespace units { - -namespace detail { - -template -struct constant_helper { - using dim = downcast_dimension>; - using ratio = ratio_multiply::ratio>; - using unit = downcast_unit; - static constexpr quantity value{1}; -}; - -} - -template -inline constexpr auto constant = detail::constant_helper::value; - -} // namespace units diff --git a/src/include/units/physical/si/constants.h b/src/include/units/physical/si/constants.h index 0530746b..3ce34bd3 100644 --- a/src/include/units/physical/si/constants.h +++ b/src/include/units/physical/si/constants.h @@ -22,7 +22,6 @@ #pragma once -#include #include #include #include @@ -33,13 +32,13 @@ namespace units::si { -inline constexpr auto planck_constant = constant, exp, exp>; -inline constexpr auto elementary_charge = constant, exp>; -inline constexpr auto boltzmann_constant = - constant, exp, exp>; -inline constexpr auto avogadro_constant = constant, exp>; -inline constexpr auto speed_of_light = constant, exp>; -inline constexpr auto hyperfine_structure_transition_frequency = constant, exp>; -// inline constexpr auto luminous_efficacy = constant, exp, exp>; +inline constexpr auto planck_constant = 6.62607015e-34q_J * 1q_s; +inline constexpr auto reduced_planck_constant = 6.582119569e-10q_GeV * 1q_s; +inline constexpr auto elementary_charge = 1.602176634e-19q_C; +inline constexpr auto boltzmann_constant = 1.380649e-23q_J / 1q_K; +inline constexpr auto avogadro_constant = 6.02214076e23 / 1q_mol; +inline constexpr auto speed_of_light = 299792458q_mps; +inline constexpr auto hyperfine_structure_transition_frequency = 9192631770q_Hz; +// inline constexpr auto luminous_efficacy = 683q_lm / 1q_W; } // namespace units::si