当前位置: 首页>>代码示例>>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;未经允许,请勿转载。