Exemplo n.º 1
0
        /// <summary>
        /// This function returns the complex arcsine of the real number a,
        /// arcsin(a).
        /// </summary>
        /// <param name="a">The function argument.</param>
        /// <returns>The complex arcsine of the real number a.</returns>
        /// <remarks>
        /// For a between -1 and 1, the
        /// function returns a real value in the range -(pi,pi]. For
        /// a less than -1 the result has a real part of -pi/2
        /// and a positive imaginary part.  For a greater than 1 the
        /// result has a real part of pi/2 and a negative imaginary part.
        /// </remarks>
        public static Complex Asin(double a)
        {
            Complex z;

            if (Math.Abs(a) <= 1.0)
            {
                z = new Complex(Math.Asin(a), 0.0);
            }
            else
            {
                if (a < 0.0)
                {
                    z = new  Complex(-M_PI_2, RMath.Acosh(-a));
                }
                else
                {
                    z = new Complex(M_PI_2, -RMath.Acosh(a));
                }
            }

            return(z);
        }
Exemplo n.º 2
0
        /// <summary>
        /// This function returns the complex hyperbolic arccosine of
        /// the real number a, arccosh(a).
        /// </summary>
        /// <param name="a">Function argument.</param>
        /// <returns>The complex hyperbolic arccosine of
        /// the real number a.</returns>
        public static Complex Acosh(double a)
        {
            Complex z;

            if (a >= 1)
            {
                z = new Complex(RMath.Acosh(a), 0);
            }
            else
            {
                if (a >= -1.0)
                {
                    z = new Complex(0, Math.Acos(a));
                }
                else
                {
                    z = new Complex(RMath.Acosh(-a), M_PI);
                }
            }

            return(z);
        }
Exemplo n.º 3
0
        /// <summary>
        /// This function returns the complex arcsecant of the real number a,
        /// arcsec(a) = arccos(1/a).
        /// </summary>
        /// <param name="a">Function argument.</param>
        /// <returns>The complex arcsecant of the real number a.</returns>
        public static Complex Asec(double a)
        {
            Complex z;

            if (a <= -1.0 || a >= 1.0)
            {
                z = new Complex(Math.Acos(1 / a), 0.0);
            }
            else
            {
                if (a >= 0.0)
                {
                    z = new Complex(0, RMath.Acosh(1 / a));
                }
                else
                {
                    z = new Complex(M_PI, -RMath.Acosh(-1 / a));
                }
            }

            return(z);
        }
Exemplo n.º 4
0
        /// <summary>
        /// This function returns the complex arccosine of the real number a, arccos(a).
        /// </summary>
        /// <param name="a">The function argument.</param>
        /// <returns>The complex arccosine of the real number a.</returns>
        /// <remarks>
        /// For a between -1 and 1, the
        /// function returns a real value in the range [0,pi]. For a
        /// less than -1 the result has a real part of pi/2 and a
        /// negative imaginary part.  For a greater than 1 the result
        /// is purely imaginary and positive.
        /// </remarks>
        public static Complex Acos(double a)
        {
            Complex z;

            if (Math.Abs(a) <= 1.0)
            {
                z = new Complex(Math.Acos(a), 0);
            }
            else
            {
                if (a < 0.0)
                {
                    z = new Complex(Math.PI, -RMath.Acosh(-a));
                }
                else
                {
                    z = new Complex(0, RMath.Acosh(a));
                }
            }

            return(z);
        }