title: 2d grid interpolation
body: <p>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).</p>
  
  <p>Do I understand correctly that, for example, an array of 3x3 (all known values)</p>
  
  <pre><code>A B C
  D E F
  G H I
  </code></pre>
  
  <p>Should be interpolated in, say, 6x6 in this manner</p>
  
  <pre><code>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
  </code></pre>
  
  <p>where x marks unknown yet interpolated value, right?</p>
  
  <p>Can this be done in two nested for loops? I found <a href="http://en.wikipedia.org/wiki/Bilinear_interpolation" rel="nofollow">bilinear interpolation formula</a>, but having some trouble with adapting it to (i, j) of resulted array loop. Any advices? Thanks in advance.</p>