Crate rustamath_mks

Source
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.