I’ve been surfing the Internet for quite some time, trying to find a simple, intuitive and fast way to approximate a polynomial of the 2nd degree using 5 data points.
I am using VC ++ 2008.
I came across many libraries like cminipack, cmpfit, lmfit, etc., but none of them seem very intuitive, and it was difficult for me to implement the code.
Ultimately, I have a set of discrete values placed in a 1D array, and I try to find the “virtual maximum point” using a curve, fitting the data, and then I find the maximum point of this data with a non-integer value (where the integer value will be the highest precision, just looking at the array).
In any case, if someone did something similar to this and can point me to the package that they used, and possibly to the simplicity of the package implementation, that would be great!
I am happy to provide some test data and graphs to show you what I'm working with, but I feel that my request is quite simple. Thank you very much.
EDIT: Here is the code I wrote that works!
http://pastebin.com/tUvKmGPn
resize to change how many inputs are used
0 0 1 1 2 4 4 16 7 49
a: 1 b: 0 c: 0 Press any key to continue.,.
Thanks for the help!
source
share