Complex.Reciprocal(Complex) Method

Definition

Returns the multiplicative inverse of a complex number.

C#
public static System.Numerics.Complex Reciprocal(System.Numerics.Complex value);

Parameters

value
Complex

A complex number.

Returns

The reciprocal of value.

Examples

The following example uses the Reciprocal method to calculate the reciprocal values of several complex numbers. It also demonstrates that the result of multiplying a complex number by its reciprocal is Complex.One.

C#
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)

Remarks

The reciprocal, or multiplicative inverse, of a number x is a number y where x * y yields 1. The reciprocal of a complex number is the complex number that produces Complex.One when the two numbers are multiplied. If a complex number is represented by a + bi, its reciprocal is represented by the following expression:

aa2+b2+ba2+b2

If value is Complex.Zero, the method returns Complex.Zero. Otherwise, it returns the result of the expression Complex.One/value.

Applies to

Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0