AForge.Math.Complex.Cos C# (CSharp) Method

Cos() public static method

Calculates Cosine value of the complex number.
public static Cos ( Complex a ) : Complex
a Complex A instance.
return Complex
        public static Complex Cos(Complex a)
        {
            Complex result = Zero;

            if (a.Im == 0.0)
            {
                result.Re = System.Math.Cos(a.Re);
                result.Im = 0.0;
            }
            else
            {
                result.Re = System.Math.Cos(a.Re)*System.Math.Cosh(a.Im);
                result.Im = -System.Math.Sin(a.Re)*System.Math.Sinh(a.Im);
            }

            return result;
        }