Awesome
NaturallyUnitful.jl
This package reexports Unitful.jl alongside two extra functions:
-
natural
, a function for converting a given quantity to the Physicist's so-called "natural units", in whichħ = c = ϵ₀ = kb = 1
julia> using NaturallyUnitful julia> natural(1u"m") 5.067730759202785e6 eV^-1 julia> natural(3e8u"m/s") 1.000692285594456
natural
also accepts a keyword argumentbase
(defaults to electron volts) which determines what unit your natural quantity is constructed from. Currently, thebase
unit must have dimensions of energy.julia> natural(1u"m", base=u"GeV") 5.067730759202785e15 GeV^-1
-
unnatural
, a function for converting from natural units to a givenunnatural
unit such as metersjulia> unnatural(u"m", 5.067730759202785e6u"eV^-1") 1.0 m julia> unnatural(u"m/s", 1) 2.99792458e8 m s^-1
Installation Instructions
To install, simply open the pkg
prompt from the julia REPL by pressing ]
, and type:
pkg> add NaturallyUnitful