Complex.Reciprocal(Complex) 方法

定義

傳回複數的乘法逆元。

public:
 static System::Numerics::Complex Reciprocal(System::Numerics::Complex value);
public static System.Numerics.Complex Reciprocal (System.Numerics.Complex value);
static member Reciprocal : System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Reciprocal (value As Complex) As Complex

參數

value
Complex

複數。

傳回

value 的倒數。

範例

下列範例會 Reciprocal 使用 方法來計算數個複數的相互值。 它也會示範將複數乘以複數的結果是 Complex.One

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex[] values = { new Complex(1, 1),
                           new Complex(-1, 1),
                           new Complex(10, -1),
                           new Complex(3, 5) };
      foreach (Complex value in values)
      {
         Complex r1 = Complex.Reciprocal(value);
         Console.WriteLine("{0:N0} x {1:N2} = {2:N2}",
                           value, r1, value * r1);
      }
   }
}
// The example displays the following output:
//       (1, 1) x (0.50, -0.50) = (1.00, 0.00)
//       (-1, 1) x (-0.50, -0.50) = (1.00, 0.00)
//       (10, -1) x (0.10, 0.01) = (1.00, 0.00)
//       (3, 5) x (0.09, -0.15) = (1.00, 0.00)
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim values() As Complex = { New Complex(1, 1), 
                                  New Complex(-1, 1), 
                                  New Complex(10, -1),
                                  New Complex(3, 5) }
      For Each value As Complex In values         
         Dim r1 As Complex = Complex.Reciprocal(value)                   
         Console.WriteLine("{0:N0} x {1:N2} = {2:N2}", 
                           value, r1, value * r1)
      Next
   End Sub
End Module
' The example displays the following output:
'       (1, 1) x (0.50, -0.50) = (1.00, 0.00)
'       (-1, 1) x (-0.50, -0.50) = (1.00, 0.00)
'       (10, -1) x (0.10, 0.01) = (1.00, 0.00)
'       (3, 5) x (0.09, -0.15) = (1.00, 0.00)

備註

數位 x 的相互或乘法反數是數位 y ,其中 x乘以 1 。 複數的相互是乘以兩個數字時所產生的 Complex.One 複數。 如果複數是以 +bi 表示,則其相互表示方式是由運算式 a/ (2+b2) + -b/ (2 + b2) 。

如果值為 Complex.Zero ,則方法會傳 Complex.Zero 回 。 否則,它會傳回運算式 Complex.One/value 的結果。

適用於