當前位置: 首頁>>代碼示例>>C#>>正文


C# Math.Complex64類代碼示例

本文整理匯總了C#中Microsoft.Scripting.Math.Complex64的典型用法代碼示例。如果您正苦於以下問題:C# Complex64類的具體用法?C# Complex64怎麽用?C# Complex64使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Complex64類屬於Microsoft.Scripting.Math命名空間,在下文中一共展示了Complex64類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ComplexConstant

 private static Expression ComplexConstant(Complex64 value) {
     if (value.Real != 0.0) {
         if (value.Imag != 0.0) {
             return Expression.Call(
                 typeof(Complex64).GetMethod("Make"),
                 Expression.Constant(value.Real),
                 Expression.Constant(value.Imag)
             );
         } else {
             return Expression.Call(
                 typeof(Complex64).GetMethod("MakeReal"),
                 Expression.Constant(value.Real)
             );
         }
     } else {
         return Expression.Call(
             typeof(Complex64).GetMethod("MakeImaginary"),
             Expression.Constant(value.Imag)
         );
     }
 }
開發者ID:bclubb,項目名稱:ironruby,代碼行數:21,代碼來源:ConstantExpression.cs

示例2: Pow

 public static Complex64 Pow(Complex64 baseNumber, Complex64 index)
 {
     if (baseNumber == 0)
       {
     // this is really non-sensical, but the behavior is defined in the spec, so try follow it at least.
     if (index == 0)
     {
       return 1;
     }
     return 0;
       }
       return Exp(index * Log(baseNumber));
 }
開發者ID:robertlj,項目名稱:IronScheme,代碼行數:13,代碼來源:Complex64.cs

示例3: Plus

 public static Complex64 Plus(Complex64 x) {
     return +x;
 }
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:3,代碼來源:Complex64.cs

示例4: Divide

 public static Complex64 Divide(Complex64 x, Complex64 y) {
     return x / y;
 }
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:3,代碼來源:Complex64.cs

示例5: Subtract

 public static Complex64 Subtract(Complex64 x, Complex64 y) {
     return x - y;
 }
開發者ID:KonajuGames,項目名稱:SharpLang,代碼行數:3,代碼來源:Complex64.cs

示例6: Pow

 public static Complex64 Pow(this Complex64 self, Complex64 power) {
     return self.Power(power);
 }
開發者ID:jschementi,項目名稱:iron,代碼行數:3,代碼來源:MathUtils.cs

示例7: Atan

 public static Complex64 Atan(Complex64 z)
 {
   return i/2 * Log((i + z)/(i - z));
 }
開發者ID:JamesTryand,項目名稱:IronScheme,代碼行數:4,代碼來源:Complex64.cs

示例8: Cos

        public static Complex64 Cos(Complex64 z)
        {
          Complex64 z1 = Exp(new Complex64(-z.imag, z.real));
          Complex64 z2 = Exp(new Complex64(z.imag, -z.real));

          return new Complex64(0.5 * (z1.real + z2.real), 0.5 * (z1.imag + z2.imag));
        }
開發者ID:JamesTryand,項目名稱:IronScheme,代碼行數:7,代碼來源:Complex64.cs

示例9: Mod

 public static Complex64 Mod(Complex64 x, Complex64 y) {
     return x % y;
 }
開發者ID:JamesTryand,項目名稱:IronScheme,代碼行數:3,代碼來源:Complex64.cs

示例10: GetAngle

        private static double GetAngle(Complex64 num) {
            if (IsNaN(num)) {
                return double.NaN;
            }

            if (double.IsPositiveInfinity(num.Real)) {
                if (double.IsPositiveInfinity(num.Imag)) {
                    return Math.PI * 0.25;
                } else if (double.IsNegativeInfinity(num.Imag)) {
                    return Math.PI * -0.25;
                } else {
                    return 0.0;
                }
            }

            if (double.IsNegativeInfinity(num.Real)) {
                if (double.IsPositiveInfinity(num.Imag)) {
                    return Math.PI * 0.75;
                } else if (double.IsNegativeInfinity(num.Imag)) {
                    return Math.PI * -0.75;
                } else {
                    return DoubleOps.Sign(num.Imag) * Math.PI;
                }
            }

            if (num.Real == 0.0) {
                if (num.Imag != 0.0) {
                    return Math.PI * 0.5 * Math.Sign(num.Imag);
                } else {
                    return (DoubleOps.IsPositiveZero(num.Real) ? 0.0 : Math.PI) * DoubleOps.Sign(GetImag(num));
                }
            }

            return Math.Atan2(num.Imag, num.Real);
        }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:35,代碼來源:cmath.cs

示例11: GetImag

 private static double GetImag(Complex64 num) {
     return num.Imag;
 }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:3,代碼來源:cmath.cs

示例12: IsNaN

 private static bool IsNaN(Complex64 num) {
     return double.IsNaN(num.Real) || double.IsNaN(num.Imag);
 }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:3,代碼來源:cmath.cs

示例13: IsInfinity

 private static bool IsInfinity(Complex64 num) {
     return double.IsInfinity(num.Real) || double.IsInfinity(num.Imag);
 }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:3,代碼來源:cmath.cs

示例14: Acos

 public static Complex64 Acos(Complex64 z)
 {
   return -i * Log(z + i * Sqrt(1 - Pow(z, 2)));
 }
開發者ID:JamesTryand,項目名稱:IronScheme,代碼行數:4,代碼來源:Complex64.cs

示例15: Sinh

        public static Complex64 Sinh(Complex64 z)
        {
          Complex64 z1 = Exp(z);
          Complex64 z2 = Exp(new Complex64(-z.real, -z.imag));

          return new Complex64(0.5 * (z1.real - z2.real), 0.5 * (z1.imag - z2.imag));
        }
開發者ID:JamesTryand,項目名稱:IronScheme,代碼行數:7,代碼來源:Complex64.cs


注:本文中的Microsoft.Scripting.Math.Complex64類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。