public static ComplexNumber Function2D ( int x , int y , double wavelength , double orientation , double phaseOffset , double gaussVariance , double aspectRatio ) { double X = x * Math . cos ( orientation ) + y * Math . sin ( orientation ) ; double Y = - x * Math . sin ( orientation ) + y * Math . cos ( orientation ) ; double envelope = Math . exp ( - ( ( X * X + aspectRatio * aspectRatio * Y * Y ) / ( 2 * gaussVariance * gaussVariance ) ) ) ; double real = Math . cos ( 2 * Math . PI * ( X / wavelength ) + phaseOffset ) ; double imaginary = Math . sin ( 2 * Math . PI * ( X / wavelength ) + phaseOffset ) ; return new ComplexNumber ( envelope * real , envelope * imaginary ) ; }
2 - D Complex Gabor function .