.. # split from OEMathFunctions.rst:450

.. include:: ../substitutions

.. oe:namespace:: OEMath

.. meta::
   :keywords: OEGeom3DQuaternionRotate

.. oe:function:: OEGeom3DQuaternionRotate

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

      .. oe:api::

         template<class T, class U>
         void OEGeom3DQuaternionRotate(T* xyz, const U* quat,
                                       unsigned int ncoord)
         template<class T, class U>
         void OEGeom3DQuaternionRotate(T* xyz, const U* quat,
                                       unsigned int* idx, unsigned int ncoord)

   .. oe:language:: python

      .. oe:api:: python

         OEGeom3DQuaternionRotate(xyz: OEFloatArray, quat: OEDoubleArray,
                                  ncoord: int) -> None
         OEGeom3DQuaternionRotate(xyz: OEDoubleArray, quat: OEDoubleArray,
                                  ncoord: int) -> None
         OEGeom3DQuaternionRotate(xyz: OEFloatArray, quat: OEDoubleArray,
                                  idx: int, ncoord: int) -> None
         OEGeom3DQuaternionRotate(xyz: OEDoubleArray, quat: OEDoubleArray,
                                  idx: int, ncoord: int) -> None

   Rotates the coordinates of ``xyz`` using the quaternion
   given by ``quat``. The second form only rotates the coordinates
   according to the indices given by ``idx``. 
 
   *xyz*
      Array of coordinates to rotate

   *quat*
      quaternion for rotation

   *ncoord*
      Number of coordinate sets to rotate

   *idx*
      Indices of the coordinates to rotate

