当前位置: 首页>>代码示例>>C#>>正文


C# Complex.Conjugate方法代码示例

本文整理汇总了C#中Complex.Conjugate方法的典型用法代码示例。如果您正苦于以下问题:C# Complex.Conjugate方法的具体用法?C# Complex.Conjugate怎么用?C# Complex.Conjugate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Complex的用法示例。


在下文中一共展示了Complex.Conjugate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CalculatGivensRotation

        public static Matrix CalculatGivensRotation(Complex a, Complex b)
        {
            Complex c, s, r;

            r = ComplexMath.Sqrt(a.Conjugate() * a + b.Conjugate() * b);

            if (b == 0) {
                c = 1;
                s = 0;
            } else if (a == 0) {
                c = 0;
                s = ComplexMath.Sign(b.Conjugate());
            } else {
                c = a.Abs() / r;
                s = ComplexMath.Sign(a) * b.Conjugate() / r;
            }

            Matrix givensRot = new Matrix(2);
            givensRot[0, 0] = c;
            givensRot[0, 1] = s;
            givensRot[1, 0] = -s.Conjugate();
            givensRot[1, 1] = c;

            return givensRot;
        }
开发者ID:DonDoff,项目名称:Maths,代码行数:25,代码来源:MatrixMath.cs

示例2: ComplexNumTests

        /// <summary>
        /// Test complex number type.
        /// </summary>
        /// <remarks>
        /// PASSING 10/17/2015
        /// </remarks>
        private static void ComplexNumTests()
        {
            Complex c1 = 1, c2 = 0, c3 = Complex.Unit;
            Complex c4 = new Complex(2, 2);
            Complex c5 = new Complex(2, -4);
            Complex c6 = new Complex(5, 5);
            Complex c7 = new Complex(3, 9);

            Debug.Print("Float 1 becomes: " + c1);
            Debug.Print("Float 0 becomes: " + c2);
            Debug.Print("Unit Complex is: " + c3);
            Debug.Print("The conjugate of " + c4 + " is " + c4.Conjugate());
            Debug.Print("Magnitude and Phase of " + c4 + " are " + c4.Magnitude + " and " + c4.Phase + " radians");
            Debug.Print(c4 + " + " + c5 + " is " + (c4 + c5));
            Debug.Print(c6 + " * 2 is " + (c6 * 2));
            Debug.Print(c6 + " / 5 is " + (c6 / 5));
            Debug.Print(c6 + " * " + c4 + " is " + (c6 * c4) + " with phase " + ((c6 * c4).Phase * (180 / System.Math.PI)) + " degrees");
            Debug.Print(c7 + " + 3 is " + (c7 + 3));
        }
开发者ID:xohmz,项目名称:Advanced-Crash-Detection-Computer,代码行数:25,代码来源:Program.cs

示例3: Run

        public void Run()
        {
            var a = new Complex(5.0, 6.0);
            var b = new Complex(-3.0, 4.0);

            Console.WriteLine("a            = " + a);
            Console.WriteLine("b            = " + b);
            Console.WriteLine("Re(a)        = " + a.Re());
            Console.WriteLine("Im(a)        = " + a.Im());
            Console.WriteLine("b + a        = " + b.Plus(a));
            Console.WriteLine("a - b        = " + a.Minus(b));
            Console.WriteLine("a * b        = " + a.Times(b));
            Console.WriteLine("b * a        = " + b.Times(a));
            Console.WriteLine("a / b        = " + a.Divides(b));
            Console.WriteLine("(a / b) * b  = " + a.Divides(b).Times(b));
            Console.WriteLine("conj(a)      = " + a.Conjugate());
            Console.WriteLine("|a|          = " + a.Abs());
            Console.WriteLine("tan(a)       = " + a.Tan());

            Console.ReadLine();
        }
开发者ID:vladdnc,项目名称:Algorithms-NET,代码行数:21,代码来源:ComplexWorker.cs

示例4: test

        // sample client for testing
        public static void test()
        {
            Complex a = new Complex(5.0, 6.0);
            Complex b = new Complex(-3.0, 4.0);

            System.Diagnostics.Debug.WriteLine("a            = " + a);
            System.Diagnostics.Debug.WriteLine("b            = " + b);
            System.Diagnostics.Debug.WriteLine("Re(a)        = " + a.Re);
            System.Diagnostics.Debug.WriteLine("Im(a)        = " + a.Im);
            System.Diagnostics.Debug.WriteLine("b + a        = " + b.Plus(a));
            System.Diagnostics.Debug.WriteLine("a - b        = " + a.Minus(b));
            System.Diagnostics.Debug.WriteLine("a * b        = " + a.Times(b));
            System.Diagnostics.Debug.WriteLine("b * a        = " + b.Times(a));
            System.Diagnostics.Debug.WriteLine("a / b        = " + a.Divides(b));
            System.Diagnostics.Debug.WriteLine("(a / b) * b  = " + a.Divides(b).Times(b));
            System.Diagnostics.Debug.WriteLine("conj(a)      = " + a.Conjugate());
            System.Diagnostics.Debug.WriteLine("|a|          = " + a.Abs());
            System.Diagnostics.Debug.WriteLine("tan(a)       = " + a.Tan());
        }
开发者ID:remy22,项目名称:AudioVSTToolbox,代码行数:20,代码来源:Complex.cs


注:本文中的Complex.Conjugate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。