.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEGetDistance

.. oe:function:: OEGetDistance

   .. oe:language:: c++ java csharp

      .. oe:api::

         double OEGetDistance(const OEMolBase& mol, const OEAtomBase* a,
                              const OEAtomBase* b)
         double OEGetDistance(const OEConfBase& conf, const OEAtomBase* a,
                              const OEAtomBase* b)
         double OEGetDistance(const OEMolBase& ma, const OEAtomBase* a,
                              const OEMolBase& mb, const OEAtomBase* b)
         double OEGetDistance(const OEConfBase& ca, const OEAtomBase* a,
                              const OEConfBase& cb, const OEAtomBase* b)

   .. oe:language:: python

      .. oe:api:: python

         OEGetDistance(arg1: Union[OEGraphMol,OEMol,OEQMol], a: OEAtomBase,
                       b: OEAtomBase) -> float
         OEGetDistance(conf: OEConfBase, a: OEAtomBase, b: OEAtomBase) -> float
         OEGetDistance(ma: Union[OEGraphMol,OEMol,OEQMol], a: OEAtomBase,
                       mb: Union[OEGraphMol,OEMol,OEQMol], b: OEAtomBase) -> float
         OEGetDistance(ca: OEConfBase, a: OEAtomBase, cb: OEConfBase,
                       b: OEAtomBase) -> float


   Calculates the distance between two atoms.  The first two functions which
   take a single molecule (either :ref:`OEMolBase <OEChem_OEMolBase>` or
   :ref:`OEConfBase <OEChem_OEConfBase>`) assume that the two atoms are both in
   the single molecule.  If the atoms are in different molecules, the
   function which takes two molecule arguments should be used.
   :ref:`OEConfBase <OEChem_OEConfBase>` inherits from :ref:`OEMolBase <OEChem_OEMolBase>`
   and strictly speaking the overload is not necessary.  However, the
   specific :ref:`OEConfBase <OEChem_OEConfBase>` implementation can be more
   efficient.

   *mol*
      The molecule that the pair of atom belongs to (when all atoms belong to the same molecule).

   *conf*
      The conformer that the pair of atom belongs to (when all atoms belong to the same conformer).

   *a*
      The first atom.

   *b*
      The second atom.

   *ma*
      The molecule that the first atom (atom `a`) belongs to (when the atoms are in two different molecules).

   *mb*
      The molecule that the second atom (atom `b`) belongs to (when the atoms are in two different molecules).

   *ca*
      The conformer that the first atom (atom `a`) belongs to (when the atoms are in two different conformers).

   *cb*
      The conformer that the second atom (atom `b`) belongs to (when the atoms are in two different conformers).



