Interpolation
Lagrange Interpolation
Given n+1 data points, Lagrange interpolation constructs a polynomial L(x)=Σ y_i·ℓ_i(x) where each basis polynomial ℓ_i(x) equals 1 at x_i and 0 at all other nodes. Example: (0,1),(1,3),(2,7) with x=3 gives L(3)=13.
Each basis polynomial is: ℓi(xq) = product over j≠i of (xq-xj)/(xi-xj)
lagrange-interpolation
For three points (x0,y0),(x1,y1),(x2,y2), the Lagrange interpolating polynomial evaluated at xq is: L(xq) = y0·ℓ0(xq) + y1·ℓ1(xq) + y2·ℓ2(xq)