def interpolate_z(d_target, d_start, d_end, z_start, z_end):
    """Linearly interpolate z = f(d) between two points.
    
    Parameters
    ----------
    d_target : float
        z is computed at this d value.
    d_start : float
        x coordinate of the first point.
    d_end : float
        x coordinate of the last point.
    z_start : float
        y coordinate of the first point.
    z_end : float
        y coordinate of the last point.
    
    Returns
    -------
    float
        Interpolated value of z.
    
    Usage
    -----
    >>> interpolate_z(1, 0, 2, 0, 2)
    1.0
    """
    return z_start + (z_end - z_start) * (d_target - d_start) / (d_end - d_start)