CrossLinear Interpolation 
Consider a twodimensional function y(x,z), and suppose that for any fixed value of z there is a linear relationship between x and y. In other words, the function can be written in the form 
for some onedimensional functions a(z) and b(z), representing at any given value of z the "slope" and "intercept" of y as a function of x. In practice the function may be specified (approximately) by giving the values of a(z) and b(z) for n discrete value of z denoted by z_{1}, z_{2},... z_{n}. Now suppose we're given specific values of x and z, with z in between z_{1} and z_{2}, and we are asked to "linearly interpolate" the value of the function y(x,z) with these arguments. This seemingly simple request is actually ambiguous, because there are really two different senses in which linear interpolation can be applied  and in some circumstances the difference in results can be very significant. 
The most common approach to linearly interpolating this function over the z variable would be by the formula 
where y(x,z_{i}) = a(z_{i})x + b(z_{i}). If z is half way between z_{1} and z_{2}, this would give an interpolated line that is half way between the two lines in the vertical sense, i.e., the interpolated y value will be half way between the y values at z_{1} and z_{2} at the same x value. This is illustrated by the green line in the figure below. 

However, there is another way to "linearly interpolate" between the same two lines. We could interpolate horizontally, i.e., we could use the line that is halfway between the lines for z_{1} and z_{2} in the horizontal direction. This is indicated by the red line in the figure above. It sometimes surprises people to learn that these two lines are, in general, distinct. These two forms of linear interpolation yield the same answer only if the lines for z_{1} and z_{2} are parallel. Depending on the actual form of the relationship between x, y, and z, either one or the other of these two forms of linear interpolation may be correct. (Despite this, the first form is almost always used in practice.) 
To determine the algebraic expression for crosslinear interpolation (i.e., the red line in the figure above), we must first solve (1) for x in terms of y and z, which gives 
Linear interpolation over z now gives 

where x(y,z_{i}) is given by (3) with z = z_{i} . Making this substitution and solving for y as a function of x, we arrive at the locus of crosslinear interpolation 
where Q = (z  z_{1})/(z_{2}  z_{1}) and we've set a_{i} = a(z_{i}) and b_{i} = b(z_{i}). In terms of these same symbols the original interpolation formula (3) is 
The slopes of these two loci are equal if and only if 
so in general this requires that the slopes a_{1}, a_{2} of the two given constantz lines be equal. The intercepts of the two loci are equal if and only if 
which confirms that a necessary and sufficient condition for linear and crosslinear interpolation to yield equal results (for intermediate values of z) is that a_{2} = a_{1}. 