Complex.ImaginaryOne Campo
Definição
public: static initonly System::Numerics::Complex ImaginaryOne;
public static readonly System.Numerics.Complex ImaginaryOne;
staticval mutable ImaginaryOne : System.Numerics.Complex
Public Shared ReadOnly ImaginaryOne As Complex
Valor do campo
Exemplos
O exemplo a seguir instancia um Complex valor usando a ImaginaryOne propriedade.The following example instantiates a Complex value by using the ImaginaryOne property. Em seguida, ele compara esse valor com outro valor que é instanciado chamando o Complex Construtor com uma parte real igual a zero e uma parte imaginário igual a um.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. Como a saída do exemplo mostra, os dois valores são iguais.As the output from the example shows, the two values are equal.
using System;
using System.Numerics;
public class Example
{
public static void Main()
{
Complex value = Complex.ImaginaryOne;
Console.WriteLine(value.ToString());
// Instantiate a complex number with real part 0 and imaginary part 1.
Complex value1 = new Complex(0, 1);
Console.WriteLine(value.Equals(value1));
}
}
// The example displays the following output:
// (0, 1)
// True
Imports System.Numerics
Module Example
Public Sub Main()
Dim value As Complex = Complex.ImaginaryOne
Console.WriteLine(value.ToString())
' Instantiate a complex number with real part 0 and imaginary part 1.
Dim value1 As New Complex(0, 1)
Console.WriteLine(value.Equals(value1))
End Sub
End Module
' The example displays the following output:
' (0, 1)
' True