.. include:: ../substitutions

.. oe:namespace:: OEGrapheme

.. meta::
   :keywords: OEGetNearbyResidue

.. oe:function:: OEGetNearbyResidue

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

      .. oe:api::

         OENearestResidue OEGetNearbyResidue(const OE2DActiveSiteDisplay& disp,
                                             const OEDepict::OE2DPoint& point,
                                             double radiusscale = 1.0)

   .. oe:language:: python

      .. oe:api:: python

         OEGetNearbyResidue(disp: OE2DActiveSiteDisplay, p: OE2DPoint,
                            radiusscale: float = 1.0) -> OENearestResidue

   Returns an :ref:`OENearestResidue <OEGrapheme_OENearestResidue>` object that stores
   the residue which is depicted nearest to a given 2D display coordinates.
   By default, only residues that not further than a radius distance from
   the given point will be considered.

   *disp*
      The :ref:`OE2DActiveSiteDisplay <OEGrapheme_OE2DActiveSiteDisplay>` object of which atoms
      are being considered.

   *point*
      Specifies the 2D display coordinates.

   *radiusscale*
       The multiplier that can be used to increase or to decrease the
       radius around the given point to be considered.
       This value has to be in a range of :math:`[0.75, 3.0]`.

   .. note::

      If there is no residue close to the given display coordinates,
      then the :oe:meth:`OEGrapheme::OENearestResidue::IsValid` method returns
      `false`.

   .. seealso::

      * :ref:`OENearestResidue <OEGrapheme_OENearestResidue>` class
      * :oe:func:`OEGrapheme::OEGetNearestResidue` function
