ListInterpolation
takes an array of data and interpolates between the entries. Let us interpolate between the elements of the identity matrix. For reference, this is what the identity matrix looks like:
MatrixPlot[IdentityMatrix[5]]
Now let's interpolate, and request first order interpolation:
if = ListInterpolation[IdentityMatrix[5], {{0, 1}, {0, 1}}, InterpolationOrder -> 1];
Plot[if[x, x], {x, 0, 1}]
The result is a piecewise function as expected, but not a piecewise linear function! Why? What does first order interpolation mean here?
The kind of linear interpolation I am familiar with is what ListDensityPlot
does:
ListDensityPlot[IdentityMatrix[5], DataRange -> {{0, 1}, {0, 1}}, Mesh -> All]
Construct a Delaunay triangulation of the data and interpolate on each triangle.
This is not what ListInterpolation
does (or even Interpolation
when the data is strictly on a square grid). What does ListInterpolation
do, then?
Inspired by this question:
ListInterpolation
areSpline
andHermite
$\endgroup$