Core utilities
Core utility library by Ross Smith
#include "rs-core/constants.hpp"
namespace RS;
All of the constants defined here follow the conventions of the standard
<numbers> header. Each constant is defined in two forms:
constexpr double name = [value as double];
template <std::floating_point T> constexpr T name_v = [value as T];
For the physical and astronomical constants, long and short versions of the
constant names are provided. The short names (but not the full names) are in
the RS::Constants sub-namespace to avoid name collisions when the symbols
are not needed.
The values quoted here are illustrative, mostly quoted to 4 significant figures. The values actually supplied in the header are accurate to the precision of the type or to the best known precision, whichever is appropriate.
| Constant | Value |
|---|---|
arcsec |
4.848×10-6 rad |
arcmin |
2.909×10-4 rad |
degree |
0.01745 rad |
inch |
0.0254 m |
foot |
0.3048 m |
yard |
0.9144 m |
mile |
1609 m |
nautical_mile |
1852 m |
ounce |
0.02835 kg |
pound |
0.4536 kg |
short_ton |
907.2 kg |
long_ton |
1016 kg |
pound_force |
4.448 N |
erg |
10-7 J |
foot_pound |
1.356 J |
calorie |
4.184 J |
kilocalorie |
4184 J |
ton_tnt |
4.184×109 J |
horsepower |
745.7 W |
mmHg |
133.3 Pa |
atmosphere |
101300 Pa |
zero_celsius |
273.15 K |
Sources:
| Constant | Symbol | Value |
|---|---|---|
alpha_particle_mass |
m_alpha |
6.645×10-27 kg |
atomic_mass_constant |
m_u |
1.661×10-27 kg |
avogadro_constant |
N_A |
6.022×1023 mol-1 |
boltzmann_constant |
k |
1.381×10-23 J/K |
electron_mass |
m_e |
9.109×10-31 kg |
elementary_charge |
ec |
1.602×10-19 C |
fine_structure_constant |
alpha |
7.297×10-3 dimensionless |
first_radiation_constant |
c_1 |
3.742×10-16 W m2 |
gravitational_constant |
G |
6.674×10-11 m3 kg-1 s-2 |
josephson_constant |
K_J |
4.836×1014 Hz V-1 |
molar_gas_constant |
R |
8.314 J mol-1 K-1 |
neutron_mass |
m_n |
1.675×10-27 kg |
planck_constant |
h |
6.626×10-34 J s |
proton_mass |
m_p |
1.673×10-27 kg |
rydberg_constant |
R_inf |
1.097×107 m-1 |
second_radiation_constant |
c_2 |
0.01439×10-2 m K |
speed_of_light |
c |
2.998×108 m/s |
stefan_boltzmann_constant |
sigma |
5.670×10-8 W m-2 K-4 |
vacuum_impedance |
Z_0 |
376.7 Ω |
vacuum_permeability |
mu_0 |
1.257×10-6 N A-2 |
vacuum_permittivity |
epsilon_0 |
8.854×10-12 F m-1 |
von_klitzing_constant |
R_K |
25810 Ω |
wien_constant |
b_W |
2.898×10-3 m K |