.. _theory_heightheight: ****************** Height correlation ****************** Structure factor ================ The structure factor is defined as: .. math:: S(\vec{q}) = \langle \hat{u}(\vec{q}) \hat{u}(\vec{q}) \rangle where :math:`\vec{q}` is the angular frequency. It can be used to compute the roughness exponent :math:`\zeta`: .. math:: S(|q|) \sim |q|^{-(d + 2 \zeta)} where :math:`d` is the dimension of the image. An example is shown below. .. image:: examples/structure.svg :width: 700px :class: only-light .. image:: examples/structure-dark.svg :width: 700px :class: only-dark Height-height correlation ========================= The height-height correlation corresponds to the following: .. math:: \mathcal{P} (\Delta \vec{x}) = \sqrt{ \sum_{i} \; \left( z (\vec{x}_i + \Delta \vec{x}) - z (\vec{x}_i) \right)^2 } Example ------- .. image:: examples/heightheight.svg :width: 700px .. note:: Like for the :ref:`2-point correlation `, a :ref:`mask ` can be used. Similarly, the average can be extended to that of an :ref:`ensemble ` of images. .. tabs:: .. tab:: Python :download:`heightheight.py ` .. literalinclude:: examples/heightheight.py :language: python :start-after: :end-before: .. tab:: C++ :download:`heightheight.cpp ` .. literalinclude:: examples/heightheight.cpp :language: cpp