.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OECenter

.. oe:function:: OECenter

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

      .. oe:api::

         void OECenter(OEMolBase& mol, double* t = 0)
         void OECenter(OEMCMolBase& mcmol, double* t = 0)
         void OECenter(OEConfBase& conf, double* t = 0)

   .. oe:language:: python

      .. oe:api:: python

         OECenter(arg1: Union[OEGraphMol,OEQMol], t: OEDoubleArray = None) -> None
         OECenter(mcmol: OEMol, t: OEDoubleArray = None) -> None
         OECenter(conf: OEConfBase, t: OEDoubleArray = None) -> None

   The :oe:func:`OEChem::OECenter` function moves the molecule so that its
   center of mass is located at the Cartesian position origin.  An
   optional array 't' can be passed in, which will be filled with the
   vector which describes the translation to move the molecule back to
   its original position.  For the :ref:`OEMolBase <OEChem_OEMolBase>` and
   :ref:`OEConfBase <OEChem_OEConfBase>` overloads, the 't' array, if present, is
   assumed to be at least of length three.  For the
   :oe:cls:`OEMCMolBase<OEChem::OEMCMolBase>` overload, the 't' array is assumed to be
   at least of length :oe:meth:`OEChem::OEMCMolBase::GetMaxConfIdx` ``*3``.
   In this case, the vector to move and conformer back to its original
   position would be located at ``t[OEConfBase::GetIdx()*3]``.

   *mol*
      The molecule to center.

   *conf*
      The conformer to center.

   *mcmol*
      The multi-conformer molecule to center.

   *t*
      The translation required to move molecule back to original position.

