this is a mathematical question regarding a pyhsics problem that I'm trying to solve. I have a large matrix $n \times m$. With one of the values of the matrix being the center. From that I calculate the farthest corner from the center and try to interpolate over the values between the center and the farthest point. Example:
\begin{array}{cccc} 5 & 16 & 13 & 4 \\ 2 & 28 & 31 & 22 \\ 3 & 7 & 19 & 5 \\ 15 & 14 & 9 & 12 \end{array}
Let's assume that 7 is defined as center here, the farthest corner would be 4. The diagonal would then result to $[7, 31, 4]$, which is easy to calculate. Assuming the center might be 16, the farthest corner would be 12. Now the answer isn't as trivial as before, as one would have to interpolate 31 and 19.
Is there any mathematical approach to do this other than manually finding out the areas of interpolation?
Thanks in advance!