it is commonly an easy task to build an n-th order polynomial and find the roots with numpy:
import numpy
f = numpy.poly1d([1,2,3])
print numpy.roots(f)
array([-1.+1.41421356j, -1.-1.41421356j])
However, suppose you want a polynomial of type:
f(x) = a*(x-x0)**0 + b(x-x0)**1 + ... + n(x-x0)**n
Is there a simple way to construct a numpy.poly1d type function and find the roots ? I've tried scipy.fsolve but it is very unstable as it depends highly on the choice of the starting values in my particular case.
Thanks in advance Best Regards rrrak
EDIT: Changed "polygon"(wrong) to "polynomial"(correct)