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 で、 xy を乗算すると 1 が得られます。 複素数の逆数は、2 つの数値を乗算したときに生成 Complex.One される複素数です。 複素数が +bi で表される場合、その逆数は式 a/(a2+b2) + -b/(a2 + b2) で表されます。

値が の Complex.Zero場合、メソッドは を返します Complex.Zero。 それ以外の場合は、 式 Complex.One/valueの結果を返します。

適用対象