.. include:: ../substitutions

.. oe:namespace:: OEChem

.. meta::
   :keywords: OEGetDimensionFromCoords

.. oe:function:: OEGetDimensionFromCoords

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

      .. oe:api::

         unsigned int OEGetDimensionFromCoords(const OEMolBase& mol)

   .. oe:language:: python

      .. oe:api:: python

         OEGetDimensionFromCoords(arg1: Union[OEGraphMol,OEMol,OEQMol]) -> int

   Returns the molecule's dimension from the coordinates.
   The returned value is  ``0``, ``1``, ``2`` or ``3``
   depending upon the number of coordinates for which any atom has a
   non-zero value.

   The table below illustrates the difference between the
   :oe:func:`OEChem::OEGetDimensionFromCoords` and
   :oe:func:`OEChem::OEGetMDLDimensionFromCoords` functions.

   +--------------------------+--------------------------+------------------------------+
   | Coordinates              | OEGetDimensionFromCoords | OEGetMDLDimensionFromCoords  |
   +--------+--------+--------+                          +                              +
   |  X     |  Y     |  Z     |                          |                              |
   +========+========+========+==========================+==============================+
   |  0.00  |  0.00  |  0.00  |  0D                      |  0D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  0.00  |  0.00  |  1D                      |  2D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  0.00  |  1.00  |  0.00  |  1D                      |  2D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  0.00  |  0.00  |  1.00  |  1D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  1.00  |  0.00  |  2D                      |  2D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  0.00  |  1.00  |  1.00  |  2D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  0.00  |  1.00  |  2D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+
   |  1.00  |  1.00  |  1.00  |  3D                      |  3D                          |
   +--------+--------+--------+--------------------------+------------------------------+

   .. seealso::

      * :oe:func:`OEChem::OESetDimensionFromCoords` function
      * :oe:func:`OEChem::OEGetMDLDimensionFromCoords` and :oe:func:`OEChem::OESetMDLDimensionFromCoords` functions
