# Convex Combination

Visualization of a convex combination of degree 1., 2. and 3. in Geogebra

## Introduction

Let ${\displaystyle (V,+,\cdot ,\mathbb {R} )}$ be a real vector space. A Linear combination is called a convex combination if all coefficients ${\displaystyle \lambda _{i}\in [0,1]}$ are from the unit interval [0,1] and the sum of all ${\displaystyle \lambda _{i}}$ for the vectors ${\displaystyle v_{i}\in V}$ with ${\displaystyle i\in \{1,\ldots ,n\}}$ equals 1:

${\displaystyle {\begin{array}{rcl}v&=&\lambda _{1}v_{1}+\lambda _{2}v_{2}+\dotsb +\lambda _{n}v_{n}\\&=&\sum _{i=1}^{n}\lambda _{i}v_{i},\\&{\mbox{with}}&0\leq \lambda _{i}\leq 1,\quad \sum _{i=1}^{n}\lambda _{i}=1\,.\end{array}}}$

## Convex combinations in the plane

When considering convex combinations in the plane, the underlying vector space is the two-dimensional space ${\displaystyle V:=\mathbb {R} ^{2}}$. First, we consider convex combinations of two vectors in ${\displaystyle \mathbb {R} ^{2}}$. By the condition ${\displaystyle \lambda _{1}+\lambda _{2}=1}$, both scalars are dependent on each other. If ${\displaystyle tis\in [0,1]}$, then set ${\displaystyle \lambda _{1}:=(1-t)}$ and ${\displaystyle \lambda _{2}:=t}$, for example.

### Convex combinations as mappings into vector space

Considering now a mapping ${\displaystyle K\colon [0,1]\to V}$, we can generally represent 1st order convex combinations of 2 vectors ${\displaystyle v_{1},v_{2}\in V}$ as follows over the mapping ${\displaystyle K}$:

${\displaystyle K(t):=(1-t)\cdot v_{1}+t\cdot v_{2}}$

### Convex combinations of 2 vectors in function spaces

Treating convex combination with ${\displaystyle v_{1},v_{2}\in \mathbb {R} ^{2}}$ or ${\displaystyle v_{1},v_{2}\in \mathbb {R} ^{3}}$ provides an illustration in secondary school vector spaces as special linear combinations. However, convex combinations can also be applied to function spaces. For example, let ${\displaystyle f,g\in V:={\mathcal {C}}([a,b],\mathbb {R} )}$, then ${\displaystyle \lambda _{1},\lambda _{2}\in [0,1]}$ and ${\displaystyle \lambda _{1}+\lambda _{2}=1}$ give rise to a new function ${\displaystyle h_{t}\in V}$ with:

${\displaystyle h_{t}:=(1-t)\cdot f+t\cdot g}$

The subscript ${\displaystyle t}$ in ${\displaystyle h_{t}}$ is used because a different function ${\displaystyle h_{t}}$ is defined as a function of ${\displaystyle t}$.

### Example of convex combinations of functions

Let ${\displaystyle [a,b]=[4,7]}$ and as the first function ${\displaystyle f:[a,b]\to \mathbb {R} }$ a polynomial is defined.

${\displaystyle f(x):={\frac {3}{10}}\cdot x^{2}-2}$

A trigonometric function ${\displaystyle g:[a,b]\to \mathbb {R} }$ is chosen as the second function.

${\displaystyle g(x):=2\cdot cos(x)+1}$

The following figure illustrates the convex combination ${\displaystyle K(t):=(1-t)\cdot f+t\cdot g}$.

### Animation for convex combinations of functions

The following animation shows several convex combinations of two given functions[1].

### Remark - Deformation

If the first function ${\displaystyle f}$ describes the initial shape and ${\displaystyle g}$ describes the target shape, convex combinations can be described, for example, in computer graphics for the deformation of an initial shape into a target shape.

## Convex combinations of convex combinations

In the animation above you can see a convex combination of 2 vectors viewed in the plane or in a function space. If one uses three points then one can create a 1st order convex combination between every two points. We will now consider higher order convex combinations by constructing, for example, a 2nd order convex combination from two 1st order convex combinations. Generally from 2 convex combinations of order ${\displaystyle n}$ one convex combination of order ${\displaystyle n+1}$ can be formed.

### Convex hull

The set of all convex combinations of a given set of vectors is called a convex hull (see also p-convex hull).

### Remarks Video about convex combinations of order 1, 2 and 3 in Geogebra

In the video you can see convex combinations of the

• 1st order between ${\displaystyle A_{1}}$ and ${\displaystyle B_{1}}$ without auxiliary points,
• 2nd order between ${\displaystyle A_{2}}$ and ${\displaystyle B_{2}}$ with auxiliary point ${\displaystyle S_{1}}$,
• 3rd order between ${\displaystyle A_{3}}$ and ${\displaystyle B_{3}}$ with auxiliary points ${\displaystyle H_{1},H_{2}}$,

## Convex combinations as polynomials of t

Convex combinations can be conceived as polynomials where the coefficients come from a vector space ${\displaystyle (V,+,\cdot ,\mathbb {R} )}$ (see also Polynomial Algebra). For example, if one chooses ${\displaystyle V:=\mathbb {R} ^{n}}$, one can take a convex combination ${\displaystyle K}$ to be an element of Polynomial Algebra ${\displaystyle V[t]}$.

### 3D convex combination - 1st order

For example, choosing ${\displaystyle n=3}$ and ${\displaystyle V:=\mathbb {R} ^{3}}$, a 1st order convex combination is defined as follows.

${\displaystyle A={\begin{pmatrix}1\\2\\4\end{pmatrix}},\,B={\begin{pmatrix}4\\1\\0\end{pmatrix}},\,\,K(t):=(1-t)\cdot A+t\cdot B=(B-A)\cdot t+A}$

Thus, a 1st order convex combination yields a polynomial of degree 1. with argument ${\displaystyle t}$. Represent the convex combination in Geogebra 3D with ${\displaystyle t\in [0,1]}$ (see also Representation of a Straight Line by Direction Vector and Location Vector).

### 3D convex combination - 2nd order

Choosing again ${\displaystyle n=3}$ and ${\displaystyle V:=\mathbb {R} ^{3}}$ with an auxiliary point ${\displaystyle H_{1}\in V}$, two 1st order convex combinations yield 2nd order convex combinations.

${\displaystyle H_{1}={\begin{pmatrix}2\\2\\2\end{pmatrix}},{\begin{array}{rcl}K_{(1,1)}(t)&:=&(H_{1}-A)\cdot t+A\\K_{(1,2)}(t)&:=&(B-H_{1})\cdot t+H_{1}\\K_{2}(t)&:=&((H_{1}-A)\cdot t+A)\cdot (1-t)+((B-H_{1})\cdot t+H_{1})\cdot t\end{array}}}$

Represent ${\displaystyle K_{2}}$ as a polynomial ${\displaystyle K_{2}(t)=P_{2}\cdot t^{2}+P_{1}\cdot t^{1}+P_{0}\cdot t^{0}}$ and calculate for ${\displaystyle n=2}$ (${\displaystyle n=3,4,...}$) the coefficients in ${\displaystyle P_{k}\in V=\mathbb {R} ^{3}}$.

### Bernstein polynomial - order 1

${\displaystyle {\begin{array}{rcl}K_{1}(t)&:=&A\cdot (1-t)+B\cdot t\\&=&A\cdot (1-t)^{1}\cdot t^{0}+B\cdot (1-t)^{0}\cdot t^{1}\\\end{array}}}$

### Calculation of the polynomial - order 2

${\displaystyle {\begin{array}{rcl}K_{2}(t)&:=&((H_{1}-A)\cdot t+A)\cdot (1-t)+((B-H_{1})\cdot t+H_{1})\cdot t\\&=&(H_{1}\cdot t-A\cdot t+A)-(H_{1}\cdot t^{2}-A\cdot t^{2}+A\cdot t)\\&&+(B\cdot t^{2}-H_{1}\cdot t^{2}+H_{1}\cdot t)\\&=&(B-H_{1}+A)\cdot t^{2}+2\cdot (H_{1}-A)\cdot t+A\end{array}}}$

### Bernstein polynomial - order 2

${\displaystyle {\begin{array}{rcl}K_{2}(t)&:=&((H_{1}-A)\cdot t+A)\cdot (1-t)+((B-H_{1})\cdot t+H_{1})\cdot t\\&=&A\cdot (1-t)^{2}+2\cdot H_{1}\cdot t\cdot (1-t)+B\cdot t^{2}\end{array}}}$

### Bernstein polynomial - order 3

${\displaystyle {\begin{array}{rcl}K_{3}(t)&:=&A\cdot (1-t)^{3}+3\cdot H_{1}\cdot (1-t)^{2}\cdot t+3\cdot H_{2}\cdot (1-t)\cdot t^{2}+B\cdot t^{3}\end{array}}}$

## Task: calculation of the polynomial - order 3

• Calculate the polynomial of degree 3 and derive from it the general formula for the coefficients of ${\displaystyle t^{n}}$. To do this, use the notation ${\displaystyle H_{0}:=A}$ and ${\displaystyle H_{n}:=B}$ for convex combinations of order ${\displaystyle n}$ between points ${\displaystyle A}$ and ${\displaystyle B}$ with auxiliary points ${\displaystyle H_{1},\ldots ,H_{n-1}}$.
• Prove your conjecture by complete induction.
${\displaystyle K_{n}(t):=\sum _{k=0}^{n}{n \choose k}\cdot H_{k}\cdot t^{k}\cdot (1-t)^{n-k}}$

## Interactive geogebra worksheet

The video shows an interaction with the convex combinations above. From Geogebra, the worksheet created was uploaded to the Geogebra materials page. You can use this directly in your browser at the following link:

Interactive Worksheet: Convex Combination on Geogebra

## Convex combination as a figure

A convex combination can be used to interpolate points ${\displaystyle A=v_{1}}$ and ${\displaystyle B=v_{n}}$. Furthermore, if the auxiliary points ${\displaystyle H_{1}=v_{2}}$,....${\displaystyle H_{n_{1}}=v_{n-1}}$ are given for a convex combination ${\displaystyle n}$-th order. The convex combinations can be generally thought of as mapping from the interval ${\displaystyle [0,1]}$ to ${\displaystyle \mathbb {R} ^{n}}$ as follows:

${\displaystyle {\begin{array}{rcl}K_{n}:&[0,1]&\rightarrow &\mathbb {R} ^{n}\\&t&\mapsto &\displaystyle \sum _{k=0}^{n}(1-t)^{n-k}\cdot t^{k}\cdot v_{k+1}\\&&&=(1-t)^{n}v_{1}+(1-t)^{n-1}tv_{2}+\ldots +t^{n}v_{n}\end{array}}}$

In Geogebra, you can dynamically visualize the geometric meaning of convex combinations. At the

• Download sample files of convex combinations for Geogebra as a ZIP file.
• The GitHub repository further contains a wxMaxima file for the algebraic calculation of the points lying on the convex combination. Data points from the ${\displaystyle \mathbb {R} ^{3}}$ are also included there, showing that the entire construction of the convex combination can also be applied to the ${\displaystyle \mathbb {R} ^{3}}$ or the ${\displaystyle \mathbb {R} ^{n}}$.

In the example files convex combinations of two points (vectors ${\displaystyle v_{1},v_{2}\in \mathbb {R} ^{2}}$) are treated.

## Definition of convex combinations as mappings/curves in vector space

### 1st order convex combination

• 1st order convex combination generate all points on the connecting line between the two points ${\displaystyle v_{1},v_{2}\in \mathbb {R} ^{2}}$.
${\displaystyle K_{1}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot v_{1}+\lambda \cdot v_{2}}$.

### 2nd order convex combination

• A 2nd order convex combination arises with another auxiliary points ${\displaystyle h_{1}\in \mathbb {R} ^{2}}$ in the plane from the following two 1st order convex combinations:
${\displaystyle K_{1,1}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot v_{1}+\lambda \cdot h_{1}}$ (1st order convex combination between ${\displaystyle v_{1},h_{1}\in \mathbb {R} ^{2}}$)
${\displaystyle K_{1,2}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot h_{1}+\lambda \cdot v_{2}}$ (1st order convex combination between ${\displaystyle h_{1},v_{2}\in \mathbb {R} ^{2}}$)
${\displaystyle K_{2}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot K_{1,1}(\lambda )+\lambda \cdot K_{1,2}(\lambda )}$ (2nd order convex combination. Order between ${\displaystyle v_{1},v_{2}\in \mathbb {R} ^{2}}$ with auxiliary point ${\displaystyle h_{1}\in \mathbb {R} ^{2}}$)

### 3rd order convex combination

A 3rd order convex combination arises with two more auxiliary points ${\displaystyle h_{1},h_{2}\in \mathbb {R} ^{2}}$ in the plane from the following three 1st order convex combinations:

${\displaystyle K_{1,1}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot v_{1}+\lambda \cdot h_{1}}$ (1st order convex combination between ${\displaystyle v_{1},h_{1}\in \mathbb {R} ^{2}}$)
${\displaystyle K_{1,2}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot h_{1}+\lambda \cdot h_{2}}$ (1st order convex combination between ${\displaystyle h_{1},h_{2}\in \mathbb {R} ^{2}}$)
${\displaystyle K_{1,3}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot h_{2}+\lambda \cdot v_{2}}$ (1st order convex combination between ${\displaystyle h_{2},v_{2}\in \mathbb {R} ^{2}}$)

#### 2nd order convex combinations from 1st order KK

From the three 1st order convex combinations, construct two 2nd order convex combinations as follows:

${\displaystyle K_{2,1}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot K_{1,1}(\lambda )+\lambda \cdot K_{1,2}(\lambda )}$ (2nd order convex combination. Order between ${\displaystyle v_{1},h_{2}\in \mathbb {R} ^{2}}$ with auxiliary point ${\displaystyle h_{1}\in \mathbb {R} ^{2}}$)
${\displaystyle K_{2,2}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot K_{1,2}(\lambda )+\lambda \cdot K_{1,3}(\lambda )}$ (2nd order convex combination. Order between ${\displaystyle h_{1},v_{2}\in \mathbb {R} ^{2}}$ with auxiliary point ${\displaystyle h_{2}\in \mathbb {R} ^{2}}$)

#### 3rd order convex combinations from 2nd order KK

From the two 2nd order convex combinations, a 3rd order convex combination is now obtained as follows:

${\displaystyle K_{3}:[0,1]\rightarrow \mathbb {R} ^{2},\qquad \lambda \mapsto (1-\lambda )\cdot K_{2,1}(\lambda )+\lambda \cdot K_{2,2}(\lambda )}$ (2nd order convex combination. Order between ${\displaystyle v_{1},v_{2}\in \mathbb {R} ^{2}}$ with auxiliary points ${\displaystyle h_{1},h_{2}\in \mathbb {R} ^{2}}$)

### Convex combinations of n-th order

In general, a convex combination of ${\displaystyle n}$-th order has.

• ${\displaystyle n-1}$ auxiliary points ${\displaystyle h_{1},\ldots ,h_{n_{1}}}$
• ${\displaystyle n}$ 1st order convex combinations,
• ${\displaystyle n-1}$ 2nd order convex combinations,
• ...
• ${\displaystyle n-k}$ convex combinations ${\displaystyle (k+1)}$-th order,
• ...
• ${\displaystyle 1}$ convex combination n-th order,

In 3D graphics, 3rd-order convex combinations are particularly important (see Bezier curves).

### Convex combination of functions

Let ${\displaystyle \mathbb {D} }$ be a domain of definition of functions and ${\displaystyle (V,+,\cdot ,\mathbb {K} )}$ be a vector space over the body ${\displaystyle \mathbb {K} }$ (e.g. ${\displaystyle \mathbb {K} :=\mathbb {R} ,\mathbb {C} }$ and ${\displaystyle {\mathcal {C}}(\mathbb {D} ,V)}$ the set of continuous functions from ${\displaystyle \mathbb {D} }$ to ${\displaystyle V}$. A convex combination of two continuous functions ${\displaystyle f,g\in {\mathcal {C}}(\mathbb {D} ,V)}$ with ${\displaystyle \lambda \in [0,1]\subset \mathbb {K} }$ is defined by:

${\displaystyle h_{\lambda }:=(1-\lambda )\cdot f+\lambda \cdot g}$

Where

${\displaystyle {\begin{array}{rcl}h_{\lambda }:\mathbb {D} &\to &V\\z&\mapsto &h_{\lambda }(z):=(1-\lambda )\cdot f(z)+\lambda \cdot g(z)\\\end{array}}}$

## Convex combinations of more than 2 vectors

In the above case, two vectors from the underlying vector space were studied as convex combinations and higher order convex combinations were also constructed. Now the procedure is extended to more than 2 vectors, again using a parametrization over vectors ${\displaystyle (t_{1},\ldots ,t_{n})\in [0,1]^{n}}$.

### Convex combinations of 3 vectors

Extend the approach to convex combination with two parameters ${\displaystyle t_{1},t_{2}\in [0,1]}$ and vectors ${\displaystyle v_{1},v_{2},v_{2}}$ via:

${\displaystyle \lambda _{1}:=(1-t_{1}),\,\lambda _{2}:=t_{1}\cdot (1-t_{2}),\,\lambda _{3}:=t_{1}\cdot t_{2}}$

and the mapping for the convex combinations into the closed triangle defined by the three vectors ${\displaystyle v_{1},v_{2},v_{2}}$:

${\displaystyle K_{3}(t_{1},t_{2}):=\underbrace {(1-t_{1})} _{=\lambda _{1}}\cdot v_{1}+\underbrace {t_{1}\cdot (1-t_{2})} _{=\lambda _{2}}\cdot v_{2}+\underbrace {t_{1}\cdot t_{2}} _{=\lambda _{3}}\cdot v_{3}}$

### Convex combinations of 4 vectors

For 4 vectors, again use as parameterization ${\displaystyle (t_{1},t_{2})\in [0,1]\times [0,1]}$

${\displaystyle \lambda _{1}:=(1-t_{1})\cdot (1-t_{2}),\,\lambda _{2}:=t_{1}\cdot (1-t_{2}),}$
${\displaystyle \lambda _{3}:=(1-t_{1})\cdot t_{2},\,\lambda _{4}:=t_{1}\cdot t_{2}}$

The mapping ${\displaystyle K_{4}:[0,1]^{2}\to V}$ then represents all vectors from the convex hull of ${\displaystyle v_{1},v_{2},v_{3},v_{4}\in V}$.

${\displaystyle K_{4}(t_{1},t_{2}):=\underbrace {(1-t_{1})(1-t_{2})} _{=\lambda _{1}}\cdot v_{1}+\underbrace {t_{1}(1-t_{2})} _{=\lambda _{2}}\cdot v_{2}+\underbrace {(1-t_{1})t_{2}} _{=\lambda _{2}}\cdot v_{3}+\underbrace {t_{1}\cdot t_{2}} _{=\lambda _{4}}\cdot v_{3}}$

• (Geogebra) Analyze the Geogebra sample files and describe the importance of the auxiliary points for the shape of the locus line in the Dynamic Geometry Software (DGS) Geogebra.
• What role do the auxiliary points play in creating differentiable interpolations (tangent vectors).
• (Interpolation) Compare Lagrange or Newton interpolations for many data points with interpolation by several 3rd order convex combinations. What are the strengths and weaknesses (oscillation between data points) of the different methods. Veranschaulichen Sie diese mit Geogebra.

### Aufgabe - 3. Ordnung und funktionale Darstellung

• (Konvexkombination 3-ter Ordnung) Berechnen Sie die Punkte von Konvexkombinationen 3. Ordnung im ${\displaystyle \mathbb {R} ^{3}}$ mit Maxima CAS (siehe auch Maxima Tutorial der FH-Hagen).
K(t):= A * (1-t)^3 + H1 * (1-t)^2 * t + H2 * (1-t) * t^2 + B * t^3
Definieren Sie die Punkte als 3x1-Matrizen mit:
A : matrix( [-1], [3], [-4] )
• (Unterschied Konvexkombination 3er Ordnung und kubischen Splines) Analysieren Sie Gemeinsamkeiten und Unterschiede von kubischen Splines und Konvexkombinationen 3er Ordnung! Was ist der Anwendungskontext von kubischen Splines? Wann würden Sie Konvexkombinationen verwenden?

### Learning Task - Convex combination of Functions

• (Convex combination of Functions) Choose ${\displaystyle \mathbb {D} :=\mathbb {R} }$ ${\displaystyle V:=\mathbb {R} }$ and represent the convex combination of ${\displaystyle f}$ and ${\displaystyle g}$ in Geogebra with a slider ${\displaystyle \lambda }$ (analogous to the GIF animation), where ${\displaystyle f(x)=x^{2}}$ and ${\displaystyle g(x)=cos(x)}$. What do you observe when you move the slider from 0 to 1? ${\displaystyle g(x)=cos(x)}$ is bounded and ${\displaystyle f(x)=x^{2}}$ is unbounded on ${\displaystyle \mathbb {D} :=\mathbb {R} }$. What is the property of ${\displaystyle h_{\lambda }}$ for ${\displaystyle 0<\lambda <1}$?
• (Convex combinations and polynomialgebras) Summarize the convex combination of order ${\displaystyle n}$ with coefficients from a vector space by powers of ${\displaystyle t^{n}}$ and consider the coefficients from the vector space ${\displaystyle V}$ in general. How are the coefficients of the polynomials formed from the points or auxiliary points for the powers? (See also Polynomial algebra and Bezier curves).

### Learning Task - Bernstein polynomials and de-Casteljau algorithm

• (Bernstein polynomials) Analyze the connection of convex combinations as special linear combinations from linear algebra with Bernstein polynomials and Bezier curves. Bernstein polynomials for a certain degree ${\displaystyle n\in \mathbb {N} }$ represent a decomposition of one. Which relation exists concerning a decomposition of one for convex combinations. What is the meaning of a polynomial representation with respect to a decomposition of one?
${\displaystyle \lambda _{1}+\ldots +\lambda _{n}=\sum _{k=1}^{n}\lambda _{k}=1}$

## Interpolations

Convex combinations can also be used to interpolate polynomials. Start first with first order interpolations by interpolating the points with straight lines of the form ${\displaystyle f_{k}(x):=m_{k}\cdot x+b_{k}}$. Here, the points ${\displaystyle \mathbb {D} :=\{(x_{0},y_{0}),\ldots ,(x_{n},y_{n})\}}$ are given data points that are interpolated piecewise using the functions ${\displaystyle f_{k}(x):=m_{k}\cdot x+b_{k}}$. Compute from the convex combinations ${\displaystyle P_{k}(t)\in \mathbb {R} ^{2}}$ the functional representation ${\displaystyle f_{k}:[x_{k-1},x_{k}]\to \mathbb {R} }$ with ${\displaystyle f_{k}(x):=m_{k}\cdot x+b_{k}}$:

${\displaystyle P_{k}(t):=(1-t)\cdot {\begin{pmatrix}x_{k-1}\\y_{k-1}\end{pmatrix}}+t\cdot {\begin{pmatrix}x_{k}\\y_{k}\end{pmatrix}}}$

### Calculation of t as a function of x

Given ${\displaystyle x\in [x_{k-1},x_{k}]\subset \mathbb {R} }$. We now compute the corresponding ${\displaystyle t\in [0,1]}$ for the convex combination with the preliminary consideration that ${\displaystyle t=0}$ for ${\displaystyle x=x_{k-1}}$ and ${\displaystyle t=1}$ for ${\displaystyle x=x_{k}}$. The following figure takes the linear transformation ${\displaystyle T:[x_{k-1},x_{k}]\to [0,1]}$.

${\displaystyle T(x):={\frac {x-x_{k-1}}{x_{k}-x_{k-1}}}}$

### Calculation of the function value at x

The convex combination

${\displaystyle P_{k}(t):=(1-t)\cdot {\begin{pmatrix}x_{k-1}\\y_{k-1}\end{pmatrix}}+t\cdot {\begin{pmatrix}x_{k}\\y_{k}\end{pmatrix}}}$

gives the interpolation point of the graph. However, we only need the y-coordinate of the corresponding interpolation point ${\displaystyle P_{k}(t)={\begin{pmatrix}(1-t)\cdot x_{k-1}+t\cdot x_{k}\\(1-t)\cdot y_{k-1}+t\cdot y_{k}\end{pmatrix}}}$. So we use the following term: ${\displaystyle (1-t)\cdot y_{k-1}+t\cdot y_{k}}$.

### Functional representation

Substituting for ${\displaystyle t\in [0,1]}$ gives the linear interpolation function ${\displaystyle f_{k}:[x_{k-1},x_{k}]\to \mathbb {R} }$ over:

${\displaystyle f_{k}(x):={\bigg (}1-\underbrace {\frac {x-x_{k-1}}{x_{k}-x_{k-1}}} _{=t}{\bigg )}\cdot y_{k-1}+{\bigg (}\underbrace {\frac {x-x_{k-1}}{x_{k}-x_{k-1}}} _{=t}{\bigg )}\cdot y_{k}}$.

• Calculate the coefficients ${\displaystyle m_{k},b_{k}\in \mathbb {R} }$ of the function ${\displaystyle f_{k}:[x_{k-1},x_{k}]\to \mathbb {R} }$ with ${\displaystyle f_{k}(x):=m_{k}\cdot x+b_{k}}$!