.. # split from OESystemFunctions.rst:1666

.. include:: ../substitutions

.. oe:namespace:: OESystem

.. meta::
   :keywords: OELinearInterpolate

.. attention::

   This function is available in C++ and Python only.

.. oe:function:: OELinearInterpolate

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

      .. oe:api::

         template<class GridType>
         inline GridType OELinearInterpolate(const OEFixedGrid<GridType>& grid,
                                             float x, float y, float z,
                                             const GridType& outside_grid_val)

   .. oe:language:: python

      .. oe:api:: python

         OELinearInterpolate(grid: OEFixedFloatGrid, x: float, y: float,
                             z: float, outside_grid_val: float) -> float

   Returns the tri-linear interpolation of the value at ``(x, y, z)``
   inside the ``grid``. If the point falls outside the grid,
   *outside_grid_val* is returned instead.

   .. oe:language:: python

      The following specializations exist for this template:

      =============================== =============================================
      OELinearInterpolate             OESystem::OELinearInterpolate<float>
      OEDoubleGridLinearInterpolate   OESystem::OELinearInterpolate<double>
      OEFloatGridLinearInterpolate    OESystem::OELinearInterpolate<float>
      OEIntGridLinearInterpolate      OESystem::OELinearInterpolate<int>
      =============================== =============================================
