#polynomial #numeric #math

lagrangian_interpolation

An algorithm to interpolate between points with polynomials

2 releases

0.1.1 Mar 30, 2024
0.1.0 Mar 30, 2024

#640 in Algorithms

Download history 282/week @ 2024-03-29 27/week @ 2024-04-05

309 downloads per month

Unlicense

5KB

Lagrange Interpolation

This is a technique that interpolates a function from tabulated values. An arbitrary number of tabulated values may be used, and they may have any arbitrary spacing. This is a useful routine for Gaussian Quadrature and other advanced algorithms.

Usage

Just import the single function in the crate with this statement.

use lagrange_interpolation::lagrange_interpolate;

Refer to the tests for examples of how to set up the function.

Credit

The implementation was guided by this excellent textbook on Celestial Mechanics. While I'm sure many clever FORTRAN and C implementations are available, I felt it would be nice to implement this in Rust.

No runtime deps