Expand description
MKS constants for physical constants and units of measure.
(c) 2023 Igor Lesik MIT license
This crate provides:
- Physical constants, such as the speed of light,
c
, and gravitational constant,G
. The values are available in the standard MKSA unit system (meters, kilograms, seconds, amperes). For example:let half_speed_of_light = f64::SPEED_OF_LIGHT / 2.0;
. - MKS unit type, for example:
assert_eq!(SPEED_OF_LIGHT_UNIT * TIME_UNIT, LIGHT_YEAR_UNIT);
. - Unit as a string, for example:
assert_eq!(&SPEED_OF_LIGHT_UNIT.to_string(), "[m / s]");
. - Values with units attached, for example:
let pendulum_len = MksVal::new(6.0, f64::FOOT, FOOT_UNIT);
. - Operations on values, for example:
let pendulum_len_over_accel = pendulum_len / g;
.
References:
Modules§
- list
- List of MKS constants names
Structs§
- MksUnit
- MKS unit as tuple of integer powers/dimentions (meter, kg, sec, ampere).
- MksVal
- MKS value bundled with its unit of measurement.
Constants§
- ACCEL_
UNIT - Acceleration unit
- ACRE_
UNIT - Acre
- AMPERE_
UNIT - Ampere
- ANGSTROM_
UNIT - Angstrom
- AREA_
UNIT - Area
- ASTRONOMICAL_
UNIT_ UNIT - Astronomical unit of lenght
- BARN_
UNIT - Barn
- BAR_
UNIT - Bar
- BOHR_
MAGNETON_ UNIT - Bohr magneton
- BOHR_
RADIUS_ UNIT - Bohr radius
- BOLTZMANN_
UNIT - Boltzmann
- BTU_
UNIT - Btu
- CALORIE_
UNIT - Calorie
- CANADIAN_
GALLON_ UNIT - Canadian gallon
- CARAT_
UNIT - Carat
- CUP_
UNIT - Cup
- CURIE_
UNIT - Curie
- DAY_
UNIT - Day
- DEBYE_
UNIT - Debye
- DISTANCE_
UNIT - Distance
- DYNE_
UNIT - Dyne
- ELECTRON_
CHARGE_ UNIT - Electron charge
- ELECTRON_
MAGNETIC_ MOMENT_ UNIT - Electron magnetic moment
- ELECTRON_
VOLT_ UNIT - Electron Volt
- ERG_
UNIT - Erg
- FARADAY_
UNIT - Faraday
- FATHOM_
UNIT - Fanthom
- FLUID_
OUNCE_ UNIT - Fluid ounce
- FOOTCANDLE_
UNIT - Footcandle
- FOOTLAMBERT_
UNIT - Footlambert
- FOOT_
UNIT - Foot
- GAUSS_
UNIT - Gauss
- GRAM_
FORCE_ UNIT - Gram force
- GRAVITATIONAL_
CONSTANT_ UNIT - Gravitational constant
- GRAV_
ACCEL_ UNIT - Acceleration due to gravity on Earth
- HECTARE_
UNIT - Hectare
- HORSEPOWER_
UNIT - Horsepower
- HOUR_
UNIT - Hour
- INCH_
OF_ MERCURY_ UNIT - Inch of mercury
- INCH_
OF_ WATER_ UNIT - Inch of water
- INCH_
UNIT - Inch
- JOULE_
UNIT - Joule
- KILOGRAM_
UNIT - Kilogram
- KILOMETERS_
PER_ HOUR_ UNIT - km/h dimentions is [m/s]
- KILOPOUND_
FORCE_ UNIT - Kilopound force
- KNOT_
UNIT - Knot
- LAMBERT_
UNIT - Lambert
- LIGHT_
YEAR_ UNIT - Light year
- LITER_
UNIT - Liter
- LUMEN_
UNIT - Lumen
- LUX_
UNIT - Lux
- MASS_
ELECTRON_ UNIT - Mass of electron
- MASS_
MUON_ UNIT - Mass of muon
- MASS_
NEUTRON_ UNIT - Mass neutron
- MASS_
PROTON_ UNIT - Mass of proton
- METER_
OF_ MERCURY_ UNIT - Meter of mercury
- METER_
UNIT - Meter
- METRIC_
TON_ UNIT - Metric ton
- MICRON_
UNIT - Micron
- MILES_
PER_ HOUR_ UNIT - miles/h
- MILE_
UNIT - Mile
- MIL_
UNIT - Mil
- MINUTE_
UNIT - One minute of time
- MOLAR_
GAS_ UNIT - Molar of gas
- NAUTICAL_
MILE_ UNIT - Nautical mile
- NEWTON_
UNIT - Newton force
- NUCLEAR_
MAGNETON_ UNIT - Nuclear magneton
- OUNCE_
MASS_ UNIT - Ounce mass
- PARSEC_
UNIT - Parsec
- PHOT_
UNIT - Phot
- PINT_
UNIT - Pint
- PLANCKS_
CONSTANT_ HBAR_ UNIT - Planks bar constant
- PLANCKS_
CONSTANT_ H_ UNIT - Planks constant
- POINT_
UNIT - Point
- POISE_
UNIT - Poise
- POUNDAL_
UNIT - Poundal
- POUND_
FORCE_ UNIT - Pound force
- POUND_
MASS_ UNIT - Pound mass
- PROTON_
MAGNETIC_ MOMENT_ UNIT - Photon magnetic moment
- PSI_
UNIT - Psi
- QUART_
UNIT - Quart
- RAD_
UNIT - Rad
- ROENTGEN_
UNIT - Roentgen
- RYDBERG_
UNIT - Rydberg
- SCALAR_
UNIT - Unit-less scalar
- SECOND_
UNIT - One second of time
- SOLAR_
MASS_ UNIT - Solar mass
- SPEED_
OF_ LIGHT_ UNIT - Speed of light [m / s]
- STANDARD_
GAS_ VOLUME_ UNIT - Standard gas volume
- STD_
ATMOSPHERE_ UNIT - Std atmosphere
- STEFAN_
BOLTZMANN_ CONSTANT_ UNIT - STEFAN_BOLTZMANN_CONSTANT
- STILB_
UNIT - Stilb
- STOKES_
UNIT - Stokes
- TABLESPOON_
UNIT - Tablespoon
- TEASPOON_
UNIT - Teaspoon
- TEXPOINT_
UNIT - Textpoint
- THERM_
UNIT - Therm
- THOMSON_
CROSS_ SECTION_ UNIT - THOMSON_CROSS_SECTION
- TIME_
UNIT - Time unit
- TON_
UNIT - Ton non-metric
- TORR_
UNIT - Torr
- TROY_
OUNCE_ UNIT - Troy ounce
- UK_
GALLON_ UNIT - UK gallon
- UK_
TON_ UNIT - UK ton
- UNIFIED_
ATOMIC_ MASS_ UNIT - Unified atomic mass
- US_
GALLON_ UNIT - US gallon
- VACUUM_
PERMEABILITY_ UNIT - VACUUM_PERMEABILITY
- VACUUM_
PERMITTIVITY_ UNIT - VACUUM_PERMITTIVITY
- VELOCITY_
UNIT - Velocity unit
- WEEK_
UNIT - Week
- YARD_
UNIT - Yard
Traits§
- Mks
- Constant factors for MKS constants and units.