The polynomial's degree should be # of points - 1
e.g. if there are 2 points given it should be a line.
I know I can solve this using a matrix
e.g. if there are 4 points:
the polynomial would be y = ax^3 + bx^2 + cx + d
and the matrix would be
| y0 | | x0^3 x0^2 x0 1 | | a |
| y1 | = | x1^3 x1^2 x1 1 | x | b |
| y2 | | x2^3 x2^2 x2 1 | | c |
| y3 | | x3^3 x3^2 x3 1 | | d |
and I can solve for a,b,c,d. Is there a library that can do this operation with the inputs being the points {x0,y0} to {xn,xn}?