I have a task of interpolating a 2d array of NxM to AxB, where A > N and B > M. The point of it is building a simple color coded image of an array (heat map).
Do I understand correctly that, for example, an array of 3x3 (all known values)
A B C
D E F
G H I
Should be interpolated in, say, 6x6 in this manner
A x B x x C
x x x x x x
D x E x x F
x x x x x x
x x x x x x
G x H x x I
where x marks unknown yet interpolated value, right?
Can this be done in two nested for loops? I found bilinear interpolation formula, but having some trouble with adapting it to (i, j) of resulted array loop. Any advices? Thanks in advance.