Esempio n. 1
0
        /// <summary>
        /// Lanczos window.
        /// Periodic version, useful e.g. for FFT purposes.
        /// </summary>
        public static double[] LanczosPeriodic(int width)
        {
            double phaseStep = 2.0 / width;

            var w = new double[width];

            for (int i = 0; i < w.Length; i++)
            {
                w[i] = Trig.Sinc(i * phaseStep - 1.0);
            }
            return(w);
        }
Esempio n. 2
0
        Exponential()
        {
            double exp = Math.Exp(real);

            if (IsReal)
            {
                return(new Complex(exp, 0d));
            }

            return(new Complex(
                       exp * Trig.Cosine(imag),
                       exp * Trig.Sine(imag)
                       ));
        }
Esempio n. 3
0
        HyperbolicCotangent()
        {
            if (IsReal)
            {
                return(new Complex(Trig.HyperbolicCotangent(real), 0d));
            }

            double sini  = Trig.Sine(imag);
            double sinhr = Trig.HyperbolicSine(real);
            double denom = sini * sini + sinhr * sinhr;

            return(new Complex(
                       sinhr * Trig.HyperbolicCosine(real) / denom,
                       sini * Trig.Cosine(imag) / denom
                       ));
        }
Esempio n. 4
0
        HyperbolicTangent()
        {
            if (IsReal)
            {
                return(new Complex(Trig.HyperbolicTangent(real), 0d));
            }

            double cosi  = Trig.Cosine(imag);
            double sinhr = Trig.HyperbolicSine(real);
            double denom = cosi * cosi + sinhr * sinhr;

            return(new Complex(
                       Trig.HyperbolicCosine(real) * sinhr / denom,
                       cosi * Trig.Sine(imag) / denom
                       ));
        }
Esempio n. 5
0
        Cosecant()
        {
            if (IsReal)
            {
                return(new Complex(Trig.Cosecant(real), 0d));
            }

            double sinr  = Trig.Sine(real);
            double sinhi = Trig.HyperbolicSine(imag);
            double denom = sinr * sinr + sinhi * sinhi;

            return(new Complex(
                       sinr * Trig.HyperbolicCosine(imag) / denom,
                       -Trig.Cosine(real) * sinhi / denom
                       ));
        }
Esempio n. 6
0
        Tangent()
        {
            if (IsReal)
            {
                return(new Complex(Trig.Tangent(real), 0d));
            }

            double cosr  = Trig.Cosine(real);
            double sinhi = Trig.HyperbolicSine(imag);
            double denom = cosr * cosr + sinhi * sinhi;

            return(new Complex(
                       Trig.Sine(real) * cosr / denom,
                       sinhi * Trig.HyperbolicCosine(imag) / denom
                       ));
        }
Esempio n. 7
0
 public static Complex Tanh(Complex value)
 {
     return(Trig.Tanh(value));
 }
Esempio n. 8
0
 public static Complex Cosh(Complex value)
 {
     return(Trig.Cosh(value));
 }
Esempio n. 9
0
 public static Complex Sinh(Complex value)
 {
     return(Trig.Sinh(value));
 }
Esempio n. 10
0
 public static Complex Atan(Complex value)
 {
     return(Trig.Atan(value));
 }
Esempio n. 11
0
 public static Complex Acos(Complex value)
 {
     return(Trig.Acos(value));
 }
Esempio n. 12
0
 /// <summary>Trigonometric Hyperbolic Cosine (cosh, Cosinus hyperbolicus) of this <c>Complex</c>.</summary>
 public Complex HyperbolicCosine()
 {
     if (IsReal)
     {
         return(new Complex(Trig.HyperbolicCosine(real), 0d));
     }
     return(new Complex(Trig.HyperbolicCosine(real) * Trig.Cosine(imag), Trig.HyperbolicSine(real) * Trig.Sine(imag)));
 }