def B5(b,i,j):
    """
    Equation B5 from Lyzenga 1978.

    Parameters
    ----------
    b : np.array
        Slopes from regressing depths against logged radiance values.
        For more info see the doc string for `Lyzenga1978.regressions`
        or Appendix B of Lyzenga 1978.
    i : int
        Band number.
    j : int
        Band number.

    Returns
    -------
    np.array
        Elements of the tranformation matrix A. If that doesn't mean anything
        to you, read Appendix B of Lyzenga 1978.
    """
    return b[i+1] * b[j] * ( (b[:i+1]**2).sum()**(-0.5) ) * ( (b[:i+2]**2).sum()**(-0.5) )