def stratification(height: float, value_mean: float, height_top: float,
    value_top: float) ->float:
    """
    Calculates the stratification of the temperature or relative humidity of the air volume.

    :param height: Height at which the stratification value is wanted in m.
    :type height: float
    :param value_mean: Mean value of the air volume. Assumed equal to the value at half of the height of the air volume.
    :type value_mean: float
    :param height_top: Height at the top of the boundary in m.
    :type height_top: float
    :param value_top: Value at the top of the air volume
    :type value_top: float
    :return: Value at desired height.
    :rtype: float
    """
    return value_mean - 2 * height * (value_mean - value_top) / height_top
