interpolation explained
What reaches our hands is always a scatter of points. A temperature a sensor reads every 1 second, a few values written in a table, a few keyframes of an animation. When you want the gaps, you stand up one smooth function that passes through the points and fill the blanks. That is interpolation. Unlike imitating a curve from the derivative at one point, interpolation builds a curve from the positions of many points. N points fix one polynomial of degree N-1, and no other. Yet if you add points without thinking, the curve can thrash. That trap is the Runge phenomenon. So in practice you place the points cleverly, or you join low-degree pieces, a spline. Interpolation is the ground of graphics, animation, data analysis, and numerical integration.
Drag the heights of the points and however you move them one gold curve follows, passing through all five points exactly. That is the interpolating polynomial. Two points are one line of degree 1, three points are one parabola of degree 2, and five points are one curve of degree 4. N points fix one polynomial of degree N-1, no more and no less. There are countless curves that join the points, but once you require a polynomial of degree N-1 the answer is pinned to exactly one. That is where interpolation starts.
How do you write that unique polynomial? Lagrange's way is elegant. For each node you build one basis function, a polynomial designed to be 1 at its own node and 0 at every other node. The chosen basis is drawn in gold, and the dot at its own node is gold too. Press a button and you can turn the bases on one at a time. Then the interpolating polynomial is just the weighted sum of these bases by the heights. P(x) = Σ yᵢ Lᵢ(x). Put in some node xk and only Lk is 1 and the rest are 0, so P(xk) = yk. Passing through every point exactly is guaranteed for free. There is no system of equations to solve.
You might think more points means more accuracy, but there is a trap. Interpolate the bell-shaped Runge function with equally spaced points. Gray is the true function and gold is the interpolating curve. As you add points the middle gets better, while at both ends the curve thrashes up and down. Around degree 15 the error at the ends grows several times larger than the function itself, and the error text turns red. That is the Runge phenomenon. A high-degree polynomial wants to bend freely between the nodes, so the denser you plant the points the bigger it thrashes between them. The lesson is plain. In interpolation, raising the degree without thinking is not the answer.
So what is the answer? Surprisingly you leave the interpolation method as it is and only change where you put the points. Switch from equal spacing to a Chebyshev placement, which gathers the points more densely toward both ends. When the spacing is equal the curve is gold, and when it is Chebyshev the curve is green. Same count, same Lagrange interpolation, and the blow-up at the ends settles as if it had been a lie. The intuition is this. The polynomial wants to thrash at the ends, so you plant more points at the ends and press that thrash down in advance. That is why Chebyshev is the standard in telescope-mirror design and in approximating functions. The problem was not the interpolation. It was the placement of the points.
Often you cannot choose where the points sit. You have to use them as given. Then you change the strategy altogether. Instead of covering the whole curve with one high-degree polynomial, you join low degree-3 pieces smoothly, each piece looking only at two neighboring points. That is a cubic spline, degree 3. Add points and the gold polynomial thrashes at the ends while the blue spline sticks to the true value. Because one piece does not feel a far point, a thrash in one place does not spread to the whole curve. The curves of a typeface, the body of a car in design (CAD), and animation paths are all splines. Interpolation is more than joining points. It is choosing how to join them.