08/12/2009, 07:02 PM
(08/12/2009, 06:40 PM)bo198214 Wrote: I also just see that there is a function lagrange_polynomial in sageWell that takes all the fun out of it, now doesn't it?
e.g.
# using the definition of Lagrange interpolation polynomial
sage: R = PolynomialRing(QQ, 'x')
sage: R.lagrange_polynomial([(0,1),(2,2),(3,-2),(-4,9)])
I mean this should be super easy now. Just plug in your argument-value-pairs and you have the interpolating polynomial (no matrix fuzz).
Then you can apply this interpolating polynomial to non-real values.
Or extract the coefficients as you like.
However I didnt check how long it takes

But seriously, I'll try both approaches and see which is faster.
~ Jay Daniel Fox