function BB=Bi(x,i,t,n,k)
    
    [B,Bp,Bpp,left] = Bspline(x,t,n,k);
    left= left-k+1;
    if (i>=left && i<=left+k-1)
        ii = i-left+1;
        BB = B(1,ii);
    else
        BB=0;
    end