Approximate a smooth $f(x,y)$ function with a polynomial function

49 Views Asked by At

I have a discrete function of two real variables defined as a set of point in a rectangular domain. The function is smooth. I need to approximate it with a polynomial function of the 2nd degree with the error as little as possible. What algorithm can I use to find out the constants for the polynomial?