% Ceci est la fonction grad
function g = grad( A, i, j, k)
g = (A(i,j+k)-A(i,j))^2+(A(i,j)-A(i+k,j))^(2)+(A(i+k,j+k)-A(i,j+k))^(2)+(A(i+k,j)-A(i,j))^(2);