Skip to content

Commit

Permalink
feat: export charge_number and mass_energy function
Browse files Browse the repository at this point in the history
  • Loading branch information
Beforerr committed Nov 17, 2024
1 parent da6e425 commit 961d354
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/ChargedParticles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include("./display.jl")
include("./_special_particles.jl")

export AbstractParticle, Particle, ChargedParticleImpl
export mass, charge, atomic_number, mass_number, element
export mass, charge, charge_number, atomic_number, mass_number, element, mass_energy
export is_ion, is_chemical_element, is_default_isotope
export electron, proton
end
2 changes: 2 additions & 0 deletions src/properties.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ function mass(p::AbstractParticle)
end
end

charge_number(p::AbstractParticle) = p.charge_number

"""Return the electric charge of the particle in elementary charge units"""
charge(p::AbstractParticle) = p.charge_number * Unitful.q

Expand Down

0 comments on commit 961d354

Please sign in to comment.