function [w] = g2d(x,y,mu,sigma) coef = 1/(2*pi*sigma^2); w = coef*exp(((x - mu(1))^2 + (y-mu(2))^2)/(-2*sigma^2));