Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a surface defined by values on a two-dimensional grid. I would like to find an approximate function which would give me a value for any arbitrary point within certain range of xs and ys.

My general idea is to construct some sort of polynomial, and then tweak it's coefficients by using some sort of evolutionary algorithm until the polynomial behaves as I want it to. But how should my polynomial look in general?

share|cite|improve this question

You might be interested in Lagrange interpolation (link only talks about one-variable version). Just input 100 points from your values and you'll probably get something good. You may need more points for it to be accurate at locations of high variance. If you insist on using an evolutionary algorithm, you might use it to choose near-optimal choices of data points, but in many cases you could probably do almost as well by spreading them around evenly.

Two-variable interpolation isn't on Wikipedia. But it is Google-able, and I found it described in sufficient generality in section 3 of this paper. Or, if you have access to MATLAB, a "static" 2D-interpolater has already been coded in this script (I haven't used this one, so it might be unwieldy or otherwise unsuited to your purposes).

Hope this helps you out!

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.