(list, lim)
return r
Orthonormalizes the "list" of functions using the Gram-Schmidt process.

    Example:

    >>> from sympy import Symbol
    >>> from gibbs_phenomenon import l2_gram_schmidt

    >>> x = Symbol('x', real=True)    # perform computations over reals to save time
    >>> l2_gram_schmidt([1, x, x**2], (x, -1, 1))
    [sqrt(2)/2, sqrt(6)*x/2, 3*sqrt(10)*(x**2 - 1/3)/4]
Orthonormalizes the "list" of functions using the Gram-Schmidt process.
Orthonormalizes the list of functions using the Gram - Schmidt process .
def l2_gram_schmidt(list, lim):
    """
    Orthonormalizes the "list" of functions using the Gram-Schmidt process.

    Example:

    >>> from sympy import Symbol
    >>> from gibbs_phenomenon import l2_gram_schmidt

    >>> x = Symbol('x', real=True)    # perform computations over reals to save time
    >>> l2_gram_schmidt([1, x, x**2], (x, -1, 1))
    [sqrt(2)/2, sqrt(6)*x/2, 3*sqrt(10)*(x**2 - 1/3)/4]

    """
    r = []
    for a in list:
        if r == []:
            v = a
        else:
            v = a - l2_projection(a, r, lim)
        v_norm = l2_norm(v, lim)
        if v_norm == 0:
            raise ValueError("The sequence is not linearly independent.")
        r.append(v/v_norm)
    return r
def l2_gram_schmidt ( list , lim ) : r = [ ] for a in list : if r == [ ] : v = a else : v = a - l2_projection ( a , r , lim ) v_norm = l2_norm ( v , lim ) if v_norm == 0 : raise ValueError ( "The sequence is not linearly independent." ) r . append ( v / v_norm ) return r