DlangScience / scid

Scientific library for the D programming language
Boost Software License 1.0
90 stars 31 forks source link

Constants #2

Closed MaksimZh closed 12 years ago

MaksimZh commented 12 years ago

Hello!

I post here because this repository seems to be the only one watched by all people concerned with scid.

I want to add some modules containing scientific constants and coefficients for unit conversion. The main difficulty is the names of the constants.

In my opinion names like "CONST_CGS_PLANCKS_CONSTANT_HBAR" are bulky and not convenient. On the other hand, short names are less informative.

I would suggest the following:

  1. Put information about the system of units to module name
  2. Group similar constants like Planck's h and h with bar inside one enum, e.g. in CGS PLANCK.H = 6.6...e-27, PLANCK.HBAR = = 1.0...e-27
  3. Uncertainty value (if any) should have the same name as the magnitude has with a special prefix/postfix (what should it be?)
  4. Group constants in the following modules:
    • fundamental - universal constants like Planck's constant, speed of light, elementary charge etc. and combinations of them like fine-structure constant
    • additional - constants like Bohr radius that are not pure combination of fundamental constants (e.g. depend on mass of electron) but are usually not considered as characteristics of particles or unit conversion coefficients
    • particles - characteristics of elementary particles: masses, magnetic moments etc.
    • what else?
  5. Add separate modules containing constants in different systems of units (SI, CGS, ...) i.e. the full module name would be scid.constants.cgs.fundamental
  6. Add a module containing coefficients to convert magnitudes between different measuring units
    • The module would consist of enum's which names would be the names of units and members - values of the units in terms of other units e.g. METER.ANGSTROM = 1e+10

By the way, should the names of constants be in CAPITAL letters?

What do you think about this?

MaksimZh commented 12 years ago

The work has been started: https://github.com/MaksimZh/scid/tree/constants