0

I am trying to find a function to perform Lagrange Interpolation in java. I have 3 (x,y) pairs, where x and y are BigInteger objects, and would like to use some interpolation function to determine f(0) for the polynomial f used to calculate my x,y these pairs. Something like this seems perfect, except that this class doesn't seem to actually belong to a package I can import: http://nssl.eew.technion.ac.il/files/Projects/thresholddsaimporvement/doc/javadoc/Lagrange.html

Forgive me if my question is naive, any help I can get would really be appreciated.

4

1 回答 1

0

Apache Commons Math中似乎有一个类似的课程。这可能比您发现的要可靠得多。

http://commons.apache.org/math/apidocs/org/apache/commons/math3/analysis/polynomials/PolynomialFunctionLagrangeForm.html

看来您是用 构造它PolynomialFunctionLagrangeForm(double[] x, double[] y),然后调用value(0)以获取 的值x = 0

于 2013-02-21T06:48:17.033 回答