MathOverflow is a question and answer site for professional mathematicians. 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


How can I generate the equation of a curve that matches all arbitrarily given (x,y) pairs? I would like a polynomial of nth degree, where n does not matter, as long as the curve passes thru all the given points.

I guess this problem is NP-complete. If so, how do I find the closest matching curve in a feasible amount of time?

Furthermore; how do I generate a piecewise polynomial, in case the given (x,y) pairs are discontinuous, or they draw the shape of a, say, circle?

Thanks in advance.

share|cite|improve this question

closed as too localized by Igor Rivin, Douglas Zare, Felipe Voloch, Qiaochu Yuan, Tom Leinster Feb 5 '11 at 23:03

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

This question will surely get closed, since it's not at research level. Look up Lagrange interpolation. – Andreas Blass Feb 5 '11 at 22:17
up vote 2 down vote accepted

Actually, there is an easy and standard procedure (Lagrange Interpolation) that does this. See:

share|cite|improve this answer
Thank you very much. – Murat Feb 5 '11 at 22:32

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