title: 2-dimensional interpolation
body: <p>I want to find a value of z at y = 12 and x = 3.5, given the below example data. How can I do this in C++?</p>
  
  <pre><code>y = 10
  x = [1,2, 3,4, 5,6]
  z = [2.3, 3.4, 5.6, 7.8, 9.6, 11.2]
  
  y = 20 
  x = [1,2, 3,4, 5,6]
  z = [4.3, 5.4, 7.6, 9.8, 11.6, 13.2]
  
  y = 30 
  x = [1,2, 3,4, 5,6]
  z = [6.3, 7.4, 8.6, 10.8, 13.6, 15.2]
  </code></pre>
  
  <hr>
  
  <p>My current Python code:</p>
  
  <pre><code>import scipy
  import math
  import numpy
  from scipy import interpolate
  
  x = [1, 2, 3, 4, 5, 6]
  y = [10, 20, 30]
  
  Y = numpy.array([[i]*len(x) for i in y])
  X = numpy.array([x for i in y])
  Z = numpy.array([[2.3, 3.4, 5.6, 7.8, 9.6, 11.2],
                   [4.3, 5.4, 7.6, 9.8, 11.6, 13.2],
                   [6.3, 7.4, 8.6, 10.8, 13.6, 15.2]]) 
  
  
  tck = interpolate.bisplrep(X, Y, Z)
  print interpolate.bisplev(3.5, 15, tck) 
  </code></pre>