C_for_Jh = function (J, h) {
const
[m, n] = size, mE = m+3, nE = n + 2,
CE = Cdiffuse_extended,
Ji = J * (n-1),
hj = h * m,
i = Math.floor(Ji) + 1,
j = Math.floor(hj) + 1,
ty = mod(Ji, 1),
tx = mod(hj, 1);
return cubic_interp(
cubic_interp(CE[(i-1)*mE + j-1], CE[(i-1)*mE + j], CE[(i-1)*mE + j+1], CE[(i-1)*mE + j+2], tx),
cubic_interp(CE[(i+0)*mE + j-1], CE[(i+0)*mE + j], CE[(i+0)*mE + j+1], CE[(i+0)*mE + j+2], tx),
cubic_interp(CE[(i+1)*mE + j-1], CE[(i+1)*mE + j], CE[(i+1)*mE + j+1], CE[(i+1)*mE + j+2], tx),
cubic_interp(CE[(i+2)*mE + j-1], CE[(i+2)*mE + j], CE[(i+2)*mE + j+1], CE[(i+2)*mE + j+2], tx),
ty);
}