Complex.Reciprocal(Complex) 方法

定义

返回复数的乘法倒数。Returns the multiplicative inverse of a complex number.

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

一个复数。A complex number.

返回

value 的倒数。The reciprocal of value.

示例

下面的示例使用 Reciprocal 方法来计算若干复数的倒数值。The following example uses the Reciprocal method to calculate the reciprocal values of several complex numbers. 它还表明,复数与其倒数相乘的结果是 Complex.OneIt also demonstrates that the result of multiplying a complex number by its reciprocal is 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)

注解

Number x的倒数或乘法倒数是数字y ,其中x乘以y将生成1。The reciprocal, or multiplicative inverse, of a number x is a number y where x multiplied by y yields 1. 复数的倒数是在两个数字相乘时产生 Complex.One 的复数。The reciprocal of a complex number is the complex number that produces Complex.One when the two numbers are multiplied. 如果复数由 + bi 表示,则其倒数由表达式 a/(a2+ b2) +-b/(a2 + b2)表示。If a complex number is represented by a +bi, its reciprocal is represented by the expression a/(a2+b2) + -b/(a2 + b2).

如果值为 Complex.Zero,则方法返回 Complex.ZeroIf value is Complex.Zero, the method returns Complex.Zero. 否则,它将返回表达式的结果 Complex.One/valueOtherwise, it returns the result of the expression Complex.One/value.

适用于