Complex.ImaginaryOne Field

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns a new Complex instance with a real number equal to zero and an imaginary number equal to one.

Namespace:  System.Numerics
Assembly:  System.Numerics (in System.Numerics.dll)

Syntax

'Declaration
Public Shared ReadOnly ImaginaryOne As Complex
public static readonly Complex ImaginaryOne

Examples

The following example instantiates a Complex value by using the ImaginaryOne property. It then compares this value to another value that is instantiated by calling the Complex constructor with a real part equal to zero and an imaginary part equal to one. As the output from the example shows, the two values are equal.

Imports System.Numerics

Module Example
   Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock)
      Dim value As Complex = Complex.ImaginaryOne
      outputBlock.Text &= value.ToString() & vbCrLf

      ' Instantiate a complex number with real part 0 and imaginary part 1.
      Dim value1 As New Complex(0, 1)
      outputBlock.Text &= value.Equals(value1) & vbCrLf
   End Sub
End Module
' The example displays the following output:
'       (0, 1)
'       True
using System;
using System.Numerics;

public class Example
{
   public static void Demo(System.Windows.Controls.TextBlock outputBlock)
   {
      Complex value = Complex.ImaginaryOne;
      outputBlock.Text += value.ToString() + "\n";

      // Instantiate a complex number with real part 0 and imaginary part 1.
      Complex value1 = new Complex(0, 1);
      outputBlock.Text += value.Equals(value1) + "\n";
   }
}
// The example displays the following output:
//       (0, 1)
//       True

Version Information

Silverlight

Supported in: 5, 4

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.