The numetricpy library provides a UnitValue class for representing physical quantities that have both a value and an associated unit. The UnitValue class overloads arithmetic operators such as +, -, *, and / to allow for easy manipulation and calculation of quantities with units. The class also overloads comparison operators such as ==, !=, <, <=, >, and >= to allow for comparison of quantities with the same units.
With the UnitValue class, it is easy to perform calculations involving physical quantities while keeping track of the units involved. This can help reduce the likelihood of errors in calculations and improve the clarity and readability of code.
This library also contains the class UnitConstants. This class contains a number of physical constants that are useful in calculations involving physical quantities.
- millimeter (mm);
- centimeter (cm)
- decimeter (dm)
- kilometer (km)
- milligram (mg)
- gram (g)
- millisecond (ms)
- minute (min)
- hour (h)
- degree Celsius (°C)
- degree Fahrenheit (°F)
- milliampere (mA)
- kiloampere (kA)
- megaampere (MA)
- kilomole (kmol)
- hertz (Hz)
- radian (rad)
- steradian (sr)
- newton (N)
- kilonewton (kN)
- pascal (Pa)
- bar (bar)
- joule (J)
- electronvolt (eV)
- calorie (cal)
- watt (W)
- horsepower (hp)
- coulomb (C)
- volt (V)
- farad (F)
- ohm (ohm)
- siemens (S)
- weber (Wb)
- tesla (T)
- henry (H)
- lumen (lm)
- lux (lx)
- becquerel (Bq)
- gray (Gy)
- sievert (Sv)
- pi (pi)
- Euler's number (e)
- speed of light in vacuum (c)
- electron charge (e)
- vacuum permeability (mu_0)
- vacuum electric permittivity (eps_0)
- Coulomb's constant (k_c)
- characteristic impedance of vacuum (Z_0)
- Planck's constant (h)
- reduced Planck's constant (h_bar)
- magnetic flux quantum (Phi_0)
- conductance quantum (G_0)
- von Klitzing constant (R_k)
- Josephson constant (K_j)
- fine structure constant (alpha)
- Boltzmann's constant (k_b, k)
- Stefan-Boltzmann constant (sigma)
- first radiation constant (c_1)
- second radiation constant (c_2)
- Wien's wavelength displacement law constant (b)
- Newtonian constant of gravitation (G)
- Earth gravity acceleration (g_earth)
- Planck mass (m_planck)
- Planck length (l_planck)
- Planck time (t_planck)
- Planck temperature (T_planck)
- Bohr radius (a_0)
- Rydberg constant (R_inf)
- Rydberg frequency constant (R_inf_c)
- Rydberg energy constant (R_inf_hc)
- Hartree energy (E_h)
- Avogadro constant (N_A)
- Faraday constant (F)
- molar gas constant (Rm)