I have variable no of coordinates of a curve lying on it.
The data points range from 50 to 10,000 in number and 1ps(1 pico second) to 10000s in value.
From the given points I have plotted the curve on HTML Canvas. Now I need to find out the Equation of the curve from the data points I have. Equation can be of any degree viz linear, quadratic, qubic.... nth degree.
I have searched over internet and found Interpolation can help. So far have found Lagrange Interpolation and Spline Interpolation.
Could anyone advise me which is the best method to find the equation(may be other than the two mentioned above). Also can Someone please guide me how can I solve these Expressions/Equations in JavaScript as I am not able to Multiply/ Divide the two or more expressions. I need to keep expressions as string or is there any better way of doing so and implementing mathematics.
A third party library could also be helpful but only if it has MIT license.