Accord.Math.Normal.Gaussian2D C# (CSharp) Method

Gaussian2D() public static method

2-D Gaussian function.

The function calculates 2-D Gaussian function:

f(x, y) = exp( x * x + y * y / ( -2 * s * s ) ) / ( s * s * 2 * PI )
public static Gaussian2D ( double sigmaSquared, double x, double y ) : double
sigmaSquared double The variance parameter σ² (sigma squared).
x double x value.
y double y value.
return double
        public static double Gaussian2D(double sigmaSquared, double x, double y)
        {
            return Math.Exp((x * x + y * y) / (-2 * sigmaSquared)) / (2 * Math.PI * sigmaSquared);
        }