let molecule = new Molecule();
molecule.bond(atomOne /* type: Atom */, atomTwo /* type: Atom */, changes /* type: Object */);
atomOne
- The first atom involved in the bondatomTwo
- The second atom involved in the bondchanges
- Changed options for the bond (see all here)Type: Molecule
The function returns the parent molecule, and is thus chainable (e.g. Molecule.modifyBond(a, b, opt).modifyBond(b, c, opt)
).
const { Molecule } = require('mcul'); let molecule = new Molecule(); let atoms = molecule.createAtoms('C', 2); molecule.bond(atoms[0], atoms[1], {count: 2}); molecule.modifyBond(atoms[0], atoms[1], {count: 3}); console.log(molecule.getBond(atoms[0], atoms[1]));