User:Berland/bicub

Interpolation with prescribed derivatives
If the function values and the derivatives are known at the four corners $$(0,0)$$, $$(1,0)$$, $$(0,1)$$, and $$(1,1)$$ of the unit square, and the interpolated surface is
 * $$p(x,y) = \sum_{i=0}^3 \sum_{j=0}^3 a_{ij} x^i y^j $$,

the interpolation problem consists of determining the 16 coefficients $$a_{ij}$$. At the corner points, the derivative in the $$x$$-direction and the $$y$$-direction is needed, as well as the cross derivative $$xy$$. This gives 16 equations that determines the 16 coefficients, where the derivatives of the inperpolated surfaces also have been used, $$p_x(x,y) = \textstyle \sum_{i=0}^3 \sum_{j=0}^3 a_{ij} i x^{i-1} y^j$$, $$p_y(x,y) = \textstyle \sum_{i=0}^3 \sum_{j=0}^3 a_{ij} x^i j y^{j-1}$$ and $$p_{xy}(x,y) = \textstyle \sum_{i=0}^3 \sum_{j=0}^3 a_{ij} i x^{i-1} j y^{j-1}$$.
 * 1) $$f(0,0)      = p(0,0)   = a_{00}$$
 * 2) $$f(1,0)      = p(1,0)   = a_{00} + a_{10} + a_{20} + a_{30}$$
 * 3) $$f(0,1)      = p(0, 1)  = a_{00} + a_{01} + a_{02} + a_{03}$$
 * 4) $$f(1,1)      = p(1,1)   = \textstyle \sum_{i=0}^3 \sum_{j=0}^3 a_{ij}$$
 * 5) $$f_x(0,0)    = p_x(0,0) = a_{10}$$
 * 6) $$f_x(1,0)    = p_x(1,0) =  a_{10} + 2a_{20} + 3a_{30}$$
 * 7) $$f_x(0,1)    = p_x(0,1) = a_{10} + a_{11} + a_{12} + a_{13}$$
 * 8) $$f_x(1,1)    = p_x(1,1) = \textstyle \sum_{i=1}^3 \sum_{j=0}^3 a_{ij} i  $$
 * 9) $$f_y(0,0)    = p_y(0,0) = a_{01}$$
 * 10) $$f_y(1,0)    = p_y(1,0) = a_{01} + a_{11} + a_{21} + a_{31}$$
 * 11) $$f_y(0,1)    = p_y(0,1) = a_{01} + 2a_{02} + 3a_{03}$$
 * 12) $$f_y(1,1)    = p_y(1,1) = \textstyle \sum_{i=0}^3 \sum_{j=1}^3 a_{ij} j $$
 * 13) $$f_{xy}(0,0) = p_{xy}(0,0) = a_{11}$$
 * 14) $$f_{xy}(1,0) = p_{xy}(1,0) = a_{11} + 2a_{21} + 3a_{31}$$
 * 15) $$f_{xy}(0,1) = p_{xy}(0,1) = a_{11} + 2a_{12} + 3a_{13}$$
 * 16) $$f_{xy}(1,1) = p_{xy}(1,1) = \textstyle \sum_{i=1}^3 \sum_{j=1}^3 a_{ij} i j $$