Math::Constants - A few constants defined in Raku
#!/usr/bin/env raku
use Math::Constants;
say "We have ", phi, " ", plancks-h, " ", plancks-reduced-h, " ",
c, " ", G, " and ", fine-structure-constant, " plus ",
elementary-charge, " and ", vacuum-permittivity ;
say "And also φ ", φ, " α ", α, " ℎ ", ℎ, " and ℏ ", ℏ,
" with e ", e, " and ε0 ", ε0;
say "We are flying at speed ", .1c;
Math::Constants is a collection of Math and Physics constants that will save you the trouble of defining them.
All the physical constants have the CODATA 2018 recommended values. These reflect the new definitions of the kilogram and ampere as of 2019-05-20.
-
Gravitational constant as
gravitation-constant
andG
. -
Speed of light as
speed-of-light-vacuum
andc
. It works also as a suffix for expressing speeds, as in3c
for 3 times the speed of light. -
Planck constant and reduced constant in J/s as
plancks-h
orℎ
andplancks-reduced-h
orℏ
. -
Boltzmann constant as
boltzmann-constant
ork
. Previous versions of Math::Constants had this in eV. The value is now in standard SI units. The eV postfix operator can be used to get the previous value if needed. -
Coulomb constant as
coulomb-constant
orK0
. -
Mass of an electron as
electron-mass
. -
Electron volt as
electron-volt
andeV
or as an operator. -
Elementary charge as
elementary-charge
orq
. -
Faraday constant as
faraday-constant
orF
. -
The fine structure constant as
fine-structure-constant
orα
. -
Gas constant as
gas-constant
orR
. -
Avogadro's constant as
avogadro-constant
orL
. -
Vacuum magnetic permeability as
magnetic-permeability
orμ0
. -
Mass of a neutron as
neutron-mass
. -
Planck length as
planck-length
orlp
. -
Planck mass as
planck-mass
ormp
. -
Planck temperature as
planck-temperature
orTp
. -
Planck time as
planck-time
ortp
. -
Mass of a proton as
proton-mass
. -
The quantum ratio (elementary charge / Planck constant) as
quantum-ratio
. -
Standard acceleration due to gravity as
standard-acceleration-gravity
org
. -
Vacuum electrical permittivity as
vacuum-permittivity
orε0
.
-
Golden ratio as
phi
orφ
. -
Feigenbaum constants as
alpha-feigenbaum-constant
anddelta-feigenbaum-constant
orδ
. -
Apéry's constant as
apery-constant
. -
Conway's constant as
conway-constant
andλ
. -
Khinchin's constant as
khinchin-constant
andk0
. -
Glaisher–Kinkelin constant as
glaisher-kinkelin-constant
andA
. -
Golomb–Dickman constant as
golomb-dickman-constant
. -
Catalan's constant as
catalan-constant
. -
Mill's constant as
mill-constant
. -
Gauss's constant as
gauss-constant
. -
Euler–Mascheroni constant as
euler-mascheroni-gamma
andγ
. -
Sierpiński's constant as
sierpinski-gamma
andK
.
"Units" can be used as suffix; the number will be multiplied by its value
eV
, or electron-volts;1.3eV
is 1.3 divided by theeV
constant value.c
, speed of light.g
, gravitational constant.
Please post them in GitHub. Pull requests are also welcome.
Check out [Physics::Constants](https://raku.land/zef:librasteve/Physics ::Constants) for an extensive collection of objects that use the Physics ::Measure objects.
-
JJ Merelo jjmerelo@gmail.com
-
Kevin Pye Kevin.Pye@gmail.com
Copyright 2016-2023 JJ Merelo
Copyright 2019 Kevin Pye
This library is free software; you can redistribute it and/or modify it under the GPL 3.0.