Piecewise linear interpolation: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
$$ | $$ | ||
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,\, \forall i\in [0,n-1], i \in N\ | ||
$$ | |||
so that | |||
$$ | |||
L(x)=L_i(x),\, x_i \le x \le x_{i+1} \\ | |||
L_i(x_i)=y_i,\, \forall \{(x_i,y_i)| i\in [0,n], i \in N\} \\ | |||
$$ | $$ | ||
Latest revision as of 19:52, 21 October 2026
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
$$ L_i(x)=a_i(x-x_i)+b_i,\, \forall i\in [0,n-1], i \in N\ $$
so that
$$\begin{gathered} L(x)=L_i(x),\, x_i \le x \le x_{i+1} \\ L_i(x_i)=y_i,\, \forall \{(x_i,y_i)| i\in [0,n], i \in N\} \\ \end{gathered}$$
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 $$