Skip to content

Latest commit

 

History

History
50 lines (33 loc) · 684 Bytes

README.md

File metadata and controls

50 lines (33 loc) · 684 Bytes

Unit utility is derived from:

Unitful.jl NaturallyUnitful.jl UnitfulAstro.jl PhysicalConstants.jl Corpuscles.jl

The following units are exported:

units_to_export = (
    :c, , ,
    :m, :s, :eV,
    :rad, , :sr,
    :c0, #:q, 
    :pc, :kpc, :Mpc, :Gpc,
    #:AU, :ly, 
    :MeV, :GeV, :TeV, :PeV, :EeV,
    :cm, :km,
    :mb,
    :Gauss, :μG,
    :Msun,
    :m_proton, :m_electron
)

Additionally, I modified Base.:/ to cancel units automatically when dividing two quantities, e.g.:

julia> c / (1m/s)
2.99792458e8

More examples:

julia> a0 = unnatural( m, ħ / (m_electron * c * α) )
5.2917721090052e-11 m