# Is a cubic Lagrange interpolation tensor product the same as bicubic interpolation?

I just implemented some interpolated texture sampling by sampling the 4x4 nearest pixels then doing Lagrange interpolation across the x axis to get four values to use Lagrange interpolation on across the y axis.

Is this the same as bicubic interpolation or is it different?

• i think the bicubic interpolation is more likely 3rd-order Hermite polynomial than 3rd-order Lagrange polynomial interpolation. the former guarantees continuity of both the zeroeth and first derivative. the latter only guarantees continuity of the zeroeth derivative (the interpolated function itself). – robert bristow-johnson Aug 4 '15 at 19:34
• Does that mean that i'd need to take 6x6 samples to get a 4x4 set of derivatives? – Alan Wolfe Aug 4 '15 at 19:48
• no, i don't think so, if i understand correctly what you mean. take a look at this recent question. cubic Lagrange insures that the 4 coefficients of your cubic polynomial are set so that the polynomial passes through all four points (even though you are interpolating between the middle two). so only the adjacent interpolating functions are continuous, their derivatives might not be. Hermite insures that your cubic polynomial passes through the 2 middle points and that the derivatives are continuous at those 2 points. – robert bristow-johnson Aug 4 '15 at 20:09
• You were correct! I've updated that shadertoy and it works great now. Care to make an answer? I'll accept it! – Alan Wolfe Aug 4 '15 at 22:56