Fits a polynomial of given degree through the specified set of points.