>>11248785By that method every four points will have a different equation though.
https://en.wikipedia.org/wiki/Bilinear_interpolation>It is assumed that we know the value of f at the four points Q11 = (x1, y1), Q12 = (x1, y2), Q21 = (x2, y1), and Q22 = (x2, y2).For example, practicing on the four points in the center of this matrix:
[ 1, 2, 3, 4, -4, -3, -2, -1]
[ 2, -3, -4, 1, -1, 4, 3, -2]
[ 3, -4, 1, -2, 2, -1, 4, -3]
[ 4, 1, -2, 3, -3, 2, -1, -4]
[-4, -1, 2, -3, 3, -2, 1, 4]
[-3, 4, -1, 2, -2, 1, -4, 3]
[-2, 3, 4, -1, 1, -4, -3, 2]
[-1, -2, -3, -4, 4, 3, 2, 1]
I got the formula:
f(x,y) = 243 -54x -54y +12xy
This works for those four points, but when I plugged in x = 1, y = 1, I got f(1, 1) = 147, when it's supposed to be 1.