Skip to main content

Function: arrowBetweenAtoms()

arrowBetweenAtoms(molecule, i, j, opts): ElectronPushingArrow

Defined in: src/mobjects/chemistry/ElectronPushingArrow.ts:314

Build an ElectronPushingArrow between two atoms of a molecule.

A convenience that reads the world positions of atoms i and j from a MoleculeMobject and returns an arrow from atom i to atom j. A positive gap trims both ends inward so the arrow clears the atom labels instead of landing on top of them.

Parameters​

molecule​

MoleculeMobject

i​

number

j​

number

opts​

ArrowBetweenAtomsOptions = {}

Returns​

ElectronPushingArrow

Throws​

Error when either atom index is out of range.