Using a list of coordinates of the turning points of a polynomial, I am trying to find a list of coefficients of the polynomial. The diagram above graphically shows what I'm trying to work out.
I have tried to use numpy.polyfit
to generate a polynomial, however the polynomial given goes through these points wherever, rather than specifically at the turning points.
Does there exist a function which could do this?
If there is no such function an approach I am considdering is to integrate (x-turningX[0])(x-turningX[1])(x-turningX[n])
to find the polynomial but I am unsure how I would go about this in python.
numpy.polyfit()
. Also please provide the data used - so I could paste the code into a file, paste the data into another file (or included in the code) and run it without adding anything to see the same result you get. – balmy