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

Basically, I have a set of up to 100 co-ordinates and their orders, in a 2D plane, along with the desired tangents to the curve at the first and last point.

I have looked into various methods of curve-fitting, by which I mean an algorithm with takes the inputted data points and tangents, and outputs the equation of the cure, such as the gaussian method and interpolation, but I really struggled understanding them.

I am not asking for code (If you choose to give it, thats acceptable though :) ), I am simply looking for help into this algorithm. It will eventually be converted to Objective-C for an iPhone app, if that changes anything..

I need the equation of the curve, given these points. Obviously there isn't a single correct equation, but i want a smooth interpolated curve as the output.

Is it possible?

share|cite|improve this question
It's hard to answer this question, because it's not clear what you're looking for. You say you found some algorithms, but didn't understand them. Do you want different algorithms, or help understanding the algorithms that you've found? – Emily Oct 22 '12 at 20:43
Are these random points or do they have some order? – picakhu Oct 22 '12 at 20:47
Least Squares would probably be a good place to start. – Ben Oct 22 '12 at 21:25
up vote 2 down vote accepted

I wrote a tutorial article on linear and non-linear least squares methods:

Linear and Non-Linear Least Squares with Math.NET

C# source code and demo app are included.

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.