# WMS:Linear Interpolation

If the linear interpolation scheme is selected, the 2D scatter points are first triangulated to form a temporary TIN. The TIN is a network of triangles connecting the scatter points together. It is used to interpolate from the scatter points to another object such as a grid or a mesh.

The equation of the plane defined by the three vertices of a triangle is as follows:

${\displaystyle Ax+By+Cz+D=0_{}^{}}$

where ${\displaystyle A}$, ${\displaystyle B}$, ${\displaystyle C}$, and ${\displaystyle D}$ are computed from the coordinates of the three vertices ${\displaystyle (x1,y1,z1)}$, ${\displaystyle (x2,y2,z2)}$, and ${\displaystyle (x3,y3,z3)}$:

${\displaystyle A=y_{1}(z_{2}-z_{3})+y_{2}(z_{3}-z_{1})+y_{3}(z_{1}-z_{2}^{})}$
${\displaystyle B=z_{1}(x_{2}-x_{3})+z_{2}(x_{3}-x_{1})+z_{3}(x_{1}-x_{2}^{})}$
${\displaystyle C=x_{1}(y_{2}-y_{3})+x_{2}(y_{3}-y_{1})+x_{3}(y_{1}-y_{2}^{})}$
${\displaystyle D=-Ax_{1}-By_{1}-Dz_{1}^{}}$

The plane equation can also be written as:

${\displaystyle z=f(x,y)=-{\frac {A}{C}}x-{\frac {B}{C}}y-{\frac {D}{C}}}$

which is the form of the plane equation used to compute the elevation at any point on the triangle.

Since a TIN only covers the convex hull of a scatter point set, extrapolation beyond the convex hull is not possible with the linear interpolation scheme. Any points outside the convex hull of the scatter point set are assigned the default extrapolation value entered at the bottom of the Interpolation Options dialog. The figure below shows a 2D scatter point set (small red triangles) being interpolated to a 2D grid. The green lines represent a TIN constructed from a scatter point set. The thick blue line represents the convex hull of the dataset. No extrapolation will occur outside of this thick blue line.

Convex hull of a dataset