Assume I have two functions, $f_1$ and $f_2$, that both depend on $x$ and $y$, so that $f_1(x,y)$ and $f_2(x,y)$.
I don't know the exact functions, but know values of each function at some points (actually, any points I want).
So, for example, let's say that:
at $x=+1$ and $y=-1$, $$f_1=+9,$$ $$f_2=+7,$$
at $x=-1$ and $y=+1$, $$f_1=-2,$$ $$f_2=-6,$$
at $x=+1$ and $y=+1,$ $$f_1=+11,$$ $$f_2=+9.$$
at $x=-1$ and $y=-1,$ $$f_1=-7,$$ $$f_2=-8.$$
I need to find the values for $x$ and $y$ where both functions equal $0$.
If each function only depended on one variable a linear interpolation would suffice. But as both functions depend on $2$ variables I'm getting a bit confused.
I've been searching on bilinear and trilinear interpolation, but I can't really pinpoint what I actually need to use.
Thank you all.
How about this way? Suppose the function can be approximated by a polynomial of degree 1, that is, $$f_1(x, y) = c_{00} + c_{10}x + c_{01}y$$ for some constants $c_{00}$, $c_{10}$, and $c_{01}$. From the first three conditions, we have $$ \begin{bmatrix} 1 & 1 & -1 \\ 1 & -1 & 1 \\ 1 & 1 & 1 \end{bmatrix} \begin{bmatrix} c_{00} \\ c_{10} \\ c_{01} \end{bmatrix} = \begin{bmatrix} f_1(1, -1) \\ f_1(-1, 1) \\ f_1(1, 1) \end{bmatrix} = \begin{bmatrix} 9 \\ -2 \\ 11 \end{bmatrix} $$ and its solution is $c_{00} = 7/2$, $c_{10} = 13/2$, and $c_{01} = 1$. Hence $$ f_1(x, y) \approx \frac{7}{2} + \frac{13}{2}x + y. $$ Do it again for $f_2$ and we get $$ f_2(x, y) \approx \frac{1}{2} + \frac{15}{2}x + y. $$ Lastly, solving $$\begin{cases} f_1(x, y) = 0 \\ f_2(x, y) = 0 \end{cases}$$ gives you $x = 3$ and $y = -23$.
If you would like to get more accurate approximation, try to do this by polynomial with higher degree.