Skip to main content

Crate yatrosci_constants

Crate yatrosci_constants 

Source
Expand description

§scirs-constants

Physical constants based on CODATA 2018 recommended values.

§Referencias

  • Tiesinga, E., Mohr, P. J., Newell, D. B., & Taylor, B. N. (2021). CODATA recommended values of the fundamental physical constants: 2018. Reviews of Modern Physics, 93(2), 025010. DOI: 10.1103/RevModPhys.93.025010

This crate provides fundamental physical constants with their exact values and uncertainties as defined by the Committee on Data for Science and Technology (CODATA) 2018 adjustment.

§Usage

use yatrosci_constants::{SPEED_OF_LIGHT, PLANCK_CONSTANT, BOLTZMANN_CONSTANT};

// Speed of light in vacuum
let c = SPEED_OF_LIGHT;

// Planck constant
let h = PLANCK_CONSTANT;

// Calculate photon energy: E = hf
let frequency = 5e14; // Hz (visible light)
let energy = h * frequency;

§Categories

Constants are organized into modules:

  • universal - Universal constants (c, G, h, etc.)
  • electromagnetic - Electromagnetic constants (e, mu_0, epsilon_0, etc.)
  • atomic - Atomic and nuclear constants (m_e, m_p, a_0, etc.)
  • physico_chemical - Physico-chemical constants (N_A, k_B, R, etc.)
  • adopted - Adopted values and conversion factors

§Uncertainties

For constants with uncertainties, companion _UNCERTAINTY constants are provided:

use yatrosci_constants::{GRAVITATIONAL_CONSTANT, GRAVITATIONAL_CONSTANT_UNCERTAINTY};

let g = GRAVITATIONAL_CONSTANT;
let delta_g = GRAVITATIONAL_CONSTANT_UNCERTAINTY;

Re-exports§

pub use universal::GRAVITATIONAL_CONSTANT;
pub use universal::GRAVITATIONAL_CONSTANT_UNCERTAINTY;
pub use universal::HBAR;
pub use universal::PLANCK_CONSTANT;
pub use universal::REDUCED_PLANCK_CONSTANT;
pub use universal::SPEED_OF_LIGHT;
pub use universal::SPEED_OF_LIGHT_VACUUM;
pub use electromagnetic::CONDUCTANCE_QUANTUM;
pub use electromagnetic::COULOMB_CONSTANT;
pub use electromagnetic::ELEMENTARY_CHARGE;
pub use electromagnetic::EPSILON_0;
pub use electromagnetic::IMPEDANCE_OF_FREE_SPACE;
pub use electromagnetic::MAGNETIC_FLUX_QUANTUM;
pub use electromagnetic::MU_0;
pub use electromagnetic::VACUUM_PERMEABILITY;
pub use electromagnetic::VACUUM_PERMITTIVITY;
pub use electromagnetic::VON_KLITZING_CONSTANT;
pub use atomic::ALPHA;
pub use atomic::ATOMIC_MASS_CONSTANT;
pub use atomic::BOHR_MAGNETON;
pub use atomic::BOHR_RADIUS;
pub use atomic::ELECTRON_G_FACTOR;
pub use atomic::ELECTRON_MASS;
pub use atomic::FINE_STRUCTURE_CONSTANT;
pub use atomic::NEUTRON_MASS;
pub use atomic::NUCLEAR_MAGNETON;
pub use atomic::PROTON_MASS;
pub use atomic::RYDBERG_CONSTANT;
pub use physico_chemical::AVOGADRO_CONSTANT;
pub use physico_chemical::BOLTZMANN_CONSTANT;
pub use physico_chemical::FARADAY_CONSTANT;
pub use physico_chemical::FIRST_RADIATION_CONSTANT;
pub use physico_chemical::GAS_CONSTANT;
pub use physico_chemical::LOSCHMIDT_CONSTANT;
pub use physico_chemical::MOLAR_GAS_CONSTANT;
pub use physico_chemical::SECOND_RADIATION_CONSTANT;
pub use physico_chemical::STEFAN_BOLTZMANN_CONSTANT;
pub use physico_chemical::WIEN_DISPLACEMENT_CONSTANT;
pub use adopted::ANGSTROM;
pub use adopted::ASTRONOMICAL_UNIT;
pub use adopted::ELECTRONVOLT;
pub use adopted::LIGHT_YEAR;
pub use adopted::MOLAR_VOLUME_IDEAL_GAS_NTP;
pub use adopted::MOLAR_VOLUME_IDEAL_GAS_STP;
pub use adopted::PARSEC;
pub use adopted::STANDARD_ATMOSPHERE;
pub use adopted::STANDARD_GRAVITY;
pub use adopted::STANDARD_STATE_PRESSURE;
pub use adopted::UNIFIED_ATOMIC_MASS_UNIT;
pub use conversions::convert_temperature;
pub use conversions::convert_temperature_str;
pub use conversions::physical_constants;
pub use conversions::ConstantEntry;
pub use conversions::TempScale;
pub use conversions::BTU;
pub use conversions::CALORIE;
pub use conversions::FOOT;
pub use conversions::HORSEPOWER;
pub use conversions::INCH;
pub use conversions::MILE;
pub use conversions::NAUTICAL_MILE;
pub use conversions::OUNCE;
pub use conversions::POUND;
pub use conversions::PSI;
pub use conversions::YARD;

Modules§

adopted
Adopted values and conversion factors (CODATA 2018)
atomic
Atomic and nuclear constants (CODATA 2018)
conversions
Temperature conversions and physical_constants dict API. Unit conversion utilities and the physical_constants dictionary.
electromagnetic
Electromagnetic constants (CODATA 2018)
math
Mathematical constants used in physics calculations
physico_chemical
Physico-chemical constants (CODATA 2018)
universal
Universal physical constants (CODATA 2018)