atom

Fill in a module description here

Element


source

Element

 Element (formula:str, charge:int=0, coordinate=None)

Initialize self. See help(type(self)) for accurate signature.

Type Default Details
formula str the chemical formula of the element
charge int 0
coordinate NoneType None
from chemformula import ChemFormula
muscarine = ChemFormula("((CH3)3N)(C6H11O2)", charge = 1, name = "L-(+)-Muscarine")
muscarine.unicode
'((CH₃)₃N)(C₆H₁₁O₂)⁺'
muscarine.element
{'C': 9, 'H': 20, 'N': 1, 'O': 2}
muscarine.hill_formula
<chemformula.ChemFormulaString>
water = Element(formula='H2O', charge=-1)
water.__dict__
{'element': {'H': 2, 'O': 1},
 'unicode': 'H₂O',
 'charge': -1,
 'coordinate': None}
water.element['H']
2
water
H₂O

Compound


source

Compound

 Compound (*args:__main__.Element)

Initialize self. See help(type(self)) for accurate signature.

Element('H2O')
H₂O
Compound(Element('H2'), Element('O'))
<__main__.Compound>

Vector


source

distance

 distance (a, b)
Type Details
a the coordinate of point a
b the coordinate of point b
Returns float the distance between vector a and vector b