Jump to content

Piecewise linear interpolation

From Wikibase
Revision as of 19:38, 21 October 2026 by Rongzhou (talk | contribs)

Languages: English · français · Esperanto

Piecewise linear interpolation is the process of finding a series of linear functions $L_i(x)$ that for a definite set of datapoints $\{(x_i,y_i)|\ i\in [0,n], i \in N\}$ satisfies $L(x_i)=y_i$.

i.e., find

$$\begin{gathered} L(x)=L_i(x),\, x_i \le x \le x_{i+1} \forall \{(x_i,y_i)| i\in [0,n], i \in N\} \\ L_i(x)=a_i(x-x_i)+b_i \end{gathered}$$

[1]

Solution

By definition,

$$ L_i(x_i)=y_i,\, L_i(x_{i+1})=y_{i+1} $$

Hence

$$ a_i=\frac{y_{i+1}-y_i}{x_{i+1}-x_i},\, b_i=y_i $$

[1]