# Given only the graphical representation of a curve, how can I find the function?

I'm developing an application which will:

A. identify curves in 2D images using the generalized Hough Transform

B. determine from the graphical curve the mathematical function needed to generate it

I'm not sure quite how to approach item B; I think that if the order $N$ of the function is known the problem can be solved by sampling $N+1$ points along the curve, and solving the quadratic/cubic/quartic... etc. formula to get the complete function:

ex. Given a curve known to be quadratic (order $2$), we can sample $3$ points to obtain three equations to solve for the $a,b, \text{ and } c$ variables in $y=ax^2+bx+c$.

The real question is how can I adapt this approach for curves whose function's polynomial order is not known-- how can I determine the polynomial order of the function needed to generate a given curve, with only the graphical representation of the curve to work with?

thanks!

-
Trig functions can be incorporated by sampling for periodicity. – gt6989b Nov 4 '13 at 18:07
Take a bunch of points, if that doesn't work out well enough, take more points and repeat. Or read up on polynomial regression. There is hardly such thing as (uniquely) identifying a function from a picture, even for polynomials. – Karolis Juodelė Nov 4 '13 at 18:19