def linear(init, final, total_steps, step):
    """
    Compute the linear interpolation between two given values
    and return the required intermediate value.

    Parameters
    ----------
    init: float
        First value.
    final: float
        Last value.
    total_steps: float
        Number of intermediate points.
    step: float
        Intermediate point to compute.

    Raises
    ------
    ZeroDivisionError
        Raised when ``total_steps`` is equal to 1.
        Instead use the ``no_decay`` function.

    Returns
    -------
    interpolation: float
        Value of the ``step`` point in the interpolation.

    Example
    -------
    >>> from neural_map import linear
    >>> linear(1.0, 0.1, 10, 5)
    0.5

    """
    return init + step * (final - init) / (total_steps - 1)