'Calculate the individual Legendre functions once and store them in a
dictionary to be reused.'

def _fcache(self, x, y):

    x_terms = (self.x_degree + 1)
    y_terms = (self.y_degree + 1)
    kfunc = {}
    kfunc[0] = np.ones(x.shape)
    kfunc[1] = x.copy()
    kfunc[x_terms] = np.ones(y.shape)
    kfunc[(x_terms + 1)] = y.copy()
    for n in range(2, x_terms):
        kfunc[n] = ((((((2 * (n - 1)) + 1) * x) * kfunc[(n - 1)]) - ((n - 1) * kfunc[(n - 2)])) / n)
    for n in range(2, y_terms):
        kfunc[(n + x_terms)] = ((((((2 * (n - 1)) + 1) * y) * kfunc[((n + x_terms) - 1)]) - ((n - 1) * kfunc[((n + x_terms) - 2)])) / n)
    return kfunc
