Complex Complex Complex Complex Struct

定義

表示複數。Represents a complex number.

public value class Complex : IEquatable<System::Numerics::Complex>, IFormattable
[System.Serializable]
public struct Complex : IEquatable<System.Numerics.Complex>, IFormattable
type Complex = struct
    interface IFormattable
Public Structure Complex
Implements IEquatable(Of Complex), IFormattable
繼承
屬性
實作

備註

複數是包含實數部分和虛數部分的數位。A complex number is a number that comprises a real number part and an imaginary number part. 複數 z 通常是以 z = x + yi 的格式撰寫, 其中xy是實數, 而i是具有i2 =-1 屬性的虛數單位。A complex number z is usually written in the form z = x + yi, where x and y are real numbers, and i is the imaginary unit that has the property i2 = -1. 複數的實數部分是以x表示, 而複數的虛數部分則是以y表示。The real part of the complex number is represented by x, and the imaginary part of the complex number is represented by y.

Complex型別在具現化和操作複數時, 會使用笛卡座標系統 (實數、虛數)。The Complex type uses the Cartesian coordinate system (real, imaginary) when instantiating and manipulating complex numbers. 複數可以表示為二維座標系統中的一個點, 也就是所謂的複雜平面。A complex number can be represented as a point in a two-dimensional coordinate system, which is known as the complex plane. 複數的實數部分位於 X 軸 (水準軸) 上, 而虛數部分位於 y 軸 (垂直軸) 上。The real part of the complex number is positioned on the x-axis (the horizontal axis), and the imaginary part is positioned on the y-axis (the vertical axis).

您也可以使用極座標系統, 根據其絕對值來表示複雜平面中的任何點。Any point in the complex plane can also be expressed based on its absolute value, by using the polar coordinate system. 在極座標中, 點有兩個數字的特徵:In polar coordinates, a point is characterized by two numbers:

  • 其大小, 也就是原點 (也就是0、0或 X 軸與 y 軸相交的點) 的距離。Its magnitude, which is the distance of the point from the origin (that is, 0,0, or the point at which the x-axis and the y-axis intersect).

  • 其階段, 這是實際軸和從原點繪製到點之間的線條之間的角度。Its phase, which is the angle between the real axis and the line drawn from the origin to the point.

具現化複數Instantiating a Complex Number

您可以使用下列其中一種方式, 將值指派給複數:You can assign a value to a complex number in one of the following ways:

  • 藉由將Double兩個值傳遞至其函式。By passing two Double values to its constructor. 第一個值代表複數的實數部分, 而第二個值表示其虛數部分。The first value represents the real part of the complex number, and the second value represents its imaginary part. 這些值代表在二維笛卡座標系統中複數的位置。These values represent the position of the complex number in the two-dimensional Cartesian coordinate system.

  • 藉由呼叫靜態 (Shared在 Visual Basic 中Complex.FromPolarCoordinates ) 方法, 從其極座標建立複數。By calling the static (Shared in Visual Basic) Complex.FromPolarCoordinates method to create a complex number from its polar coordinates.

  • 藉由將ByteSByte Int16UInt32 Complex 、、、、、、或Double值指派給物件。 UInt16 Int32 Int64 UInt64 SingleBy assigning a Byte, SByte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Single, or Double value to a Complex object. 值會變成複數的實數部分, 而其虛數部分等於0。The value becomes the real part of the complex number, and its imaginary part equals 0.

  • 藉由轉換 ( C#在中) 或將Decimal ComplexBigInteger值轉換為物件 (Visual Basic)。By casting (in C#) or converting (in Visual Basic) a Decimal or BigInteger value to a Complex object. 值會變成複數的實數部分, 而其虛數部分等於0。The value becomes the real part of the complex number, and its imaginary part equals 0.

  • 藉由將方法或運算子所傳回的複數指派給Complex物件。By assigning the complex number that is returned by a method or operator to a Complex object. 例如, Complex.Add是一種靜態方法, 它會傳回兩個複數總和的複數, Complex.Addition而運算子會加入兩個複數, 並傳回結果。For example, Complex.Add is a static method that returns a complex number that is the sum of two complex numbers, and the Complex.Addition operator adds two complex numbers and returns the result.

下列範例示範這五種將值指派給複數的方式。The following example demonstrates each of these five ways of assigning a value to a complex number.

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      // Create a complex number by calling its class constructor.
      Complex c1 = new Complex(12, 6);
      Console.WriteLine(c1);
      
      // Assign a Double to a complex number.
      Complex c2 = 3.14;
      Console.WriteLine(c2);
      
      // Cast a Decimal to a complex number.
      Complex c3 = (Complex) 12.3m;
      Console.WriteLine(c3);
      
      // Assign the return value of a method to a Complex variable.
      Complex c4 = Complex.Pow(Complex.One, -1);
      Console.WriteLine(c4);
      
      // Assign the value returned by an operator to a Complex variable.
      Complex c5 = Complex.One + Complex.One;
      Console.WriteLine(c5);

      // Instantiate a complex number from its polar coordinates.
      Complex c6 = Complex.FromPolarCoordinates(10, .524);
      Console.WriteLine(c6);
   }
}
// The example displays the following output:
//       (12, 6)
//       (3.14, 0)
//       (12.3, 0)
//       (1, 0)
//       (2, 0)
//       (8.65824721882145, 5.00347430269914)
Imports System.Numerics

Module Example
   Public Sub Main()
      ' Create a complex number by calling its class constructor.
      Dim c1 As New Complex(12, 6)
      Console.WriteLine(c1)
      
      ' Assign a Double to a complex number.
      Dim c2 As Complex = 3.14
      Console.WriteLine(c2)
      
      ' Cast a Decimal to a complex number.
      Dim c3 As Complex = CType(12.3d, Complex)
      Console.WriteLine(c3)
      
      ' Assign the return value of a method to a Complex variable.
      Dim c4 As Complex = Complex.Pow(Complex.One, -1)
      Console.WriteLine(c4)
      
      ' Assign the value returned by an operator to a Complex variable.
      Dim c5 As Complex = Complex.One + Complex.One
      Console.WriteLine(c5)

      ' Instantiate a complex number from its polar coordinates.
      Dim c6 As Complex = Complex.FromPolarCoordinates(10, .524)
      Console.WriteLine(c6)
   End Sub
End Module
' The example displays the following output:
'       (12, 6)
'       (3.14, 0)
'       (12.3000001907349, 0)
'       (1, 0)
'       (2, 0)
'       (8.65824721882145, 5.00347430269914)

具有複數的作業Operations with Complex Numbers

.NET Framework Complex中的結構包含提供下列功能的成員:The Complex structure in the .NET Framework includes members that provide the following functionality:

  • 用來比較兩個複數的方法, 以判斷它們是否相等。Methods to compare two complex numbers to determine whether they are equal.

  • 用來對複數執行算數運算的運算子。Operators to perform arithmetic operations on complex numbers. Complex運算子可讓您使用複數來執行加法、減法、乘法、除法和一元否定。Complex operators enable you to perform addition, subtraction, multiplication, division, and unary negation with complex numbers.

  • 對複數執行其他數值運算的方法。Methods to perform other numerical operations on complex numbers. 除了四個基本算數運算以外, 您還可以將複數乘到指定的乘冪, 尋找複數的平方根, 並取得複數的絕對值。In addition to the four basic arithmetic operations, you can raise a complex number to a specified power, find the square root of a complex number, and get the absolute value of a complex number.

  • 對複數執行三角函數運算的方法。Methods to perform trigonometric operations on complex numbers. 例如, 您可以計算以複數表示之角度的正切函數。For example, you can calculate the tangent of an angle represented by a complex number.

請注意, 因為RealImaginary屬性是唯讀的, 所以您無法修改現有Complex物件的值。Note that, because the Real and Imaginary properties are read-only, you cannot modify the value of an existing Complex object. 所有對Complex數位執行作業的方法, 如果其傳回值的類型Complex為, 則會傳回新Complex的數位。All methods that perform an operation on a Complex number, if their return value is of type Complex, return a new Complex number.

有效位數和複數Precision and Complex Numbers

複數的實數和虛數部分會以兩個雙精確度浮點數表示。The real and imaginary parts of a complex number are represented by two double-precision floating-point values. 這表示Complex值 (例如雙精確度浮點值) 可能會因數值運算而失去精確度。This means that Complex values, like double-precision floating-point values, can lose precision as a result of numerical operations. 這表示, 即使兩個值之間的Complex差異是因為遺失有效位數, 這兩個值的相等比較也可能會失敗。This means that strict comparisons for equality of two Complex values may fail, even if the difference between the two values is due to a loss of precision. 如需詳細資訊,請參閱DoubleFor more information, see Double.

例如, 對數位的對數執行乘冪應該會傳回原始數位。For example, performing exponentiation on the logarithm of a number should return the original number. 不過, 在某些情況下, 浮點值的精確度遺失可能會造成兩個值之間的些許差異, 如下列範例所示。However, in some cases, the loss of precision of floating-point values can cause slight differences between the two values, as the following example illustrates.

Complex value = new Complex(Double.MinValue/2, Double.MinValue/2);
Complex value2 = Complex.Exp(Complex.Log(value));
Console.WriteLine("{0} \n{1} \nEqual: {2}", value, value2, 
                                            value == value2);
// The example displays the following output:
//    (-8.98846567431158E+307, -8.98846567431158E+307)
//    (-8.98846567431161E+307, -8.98846567431161E+307)
//    Equal: False
Dim value As New Complex(Double.MinValue/2, Double.MinValue/2)
Dim value2 As Complex = Complex.Exp(Complex.Log(value))
Console.WriteLine("{0} {3}{1} {3}Equal: {2}", value, value2, 
                                              value = value2,
                                              vbCrLf)
' The example displays the following output:
'    (-8.98846567431158E+307, -8.98846567431158E+307)
'    (-8.98846567431161E+307, -8.98846567431161E+307)
'    Equal: False

同樣地, 下列範例會計算Complex數位的平方根, 在32位和 IA64 版本的 .NET Framework 上產生稍微不同的結果。Similarly, the following example, which calculates the square root of a Complex number, produces slightly different results on the 32-bit and IA64 versions of the .NET Framework.

Complex minusOne = new Complex(-1, 0);
Console.WriteLine(Complex.Sqrt(minusOne));
// The example displays the following output:
//    (6.12303176911189E-17, 1) on 32-bit systems.
//    (6.12323399573677E-17,1) on IA64 systems.
Dim minusOne As New Complex(-1, 0)
Console.WriteLine(Complex.Sqrt(minusOne))
' The example displays the following output:
'    (6.12303176911189E-17, 1) on 32-bit systems.
'    (6.12323399573677E-17,1) on IA64 systems.

複數、無限大和 NaNComplex Numbers, Infinity, and NaN

複數的實數和虛數部分會以Double值表示。The real and imaginary parts of a complex number are represented by Double values. Double.MinValue除了從Double.NaNDouble.MaxValue的範圍之外, 複數的實數或虛數部分Double.PositiveInfinity可以具有、 Double.NegativeInfinity或的值。In addition to ranging from Double.MinValue to Double.MaxValue, the real or imaginary part of a complex number can have a value of Double.PositiveInfinity, Double.NegativeInfinity, or Double.NaN. Double.PositiveInfinityDouble.NegativeInfinityDouble.NaN全都傳播在任何算術或三角函數作業中。Double.PositiveInfinity, Double.NegativeInfinity, and Double.NaN all propagate in any arithmetic or trigonometric operation.

在下列範例中, 除以Zero會產生一個複數, 其實數和虛數部分皆為兩者。 Double.NaNIn the following example, division by Zero produces a complex number whose real and imaginary parts are both Double.NaN. 如此一來, 使用這個值執行乘法也會產生一個複數, 其實際和虛數Double.NaN部分為。As a result, performing multiplication with this value also produces a complex number whose real and imaginary parts are Double.NaN. 同樣地, 如果執行的乘法超出Double類型的範圍, 就會產生複數, 其實數部分為Double.NaN , 而虛數Double.PositiveInfinity部分為。Similarly, performing a multiplication that overflows the range of the Double type produces a complex number whose real part is Double.NaN and whose imaginary part is Double.PositiveInfinity. 接著, 使用這個複數來執行除法, 會傳回一個複數, 其Double.NaN實數部分為, 而Double.PositiveInfinity其虛數部分為。Subsequently performing division with this complex number returns a complex number whose real part is Double.NaN and whose imaginary part is Double.PositiveInfinity.

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex c1 = new Complex(Double.MaxValue / 2, Double.MaxValue /2);

      Complex c2 = c1 / Complex.Zero;
      Console.WriteLine(c2.ToString());
      c2 = c2 * new Complex(1.5, 1.5);
      Console.WriteLine(c2.ToString());
      Console.WriteLine();
      
      Complex c3 = c1 * new Complex(2.5, 3.5);
      Console.WriteLine(c3.ToString());
      c3 = c3 + new Complex(Double.MinValue / 2, Double.MaxValue / 2); 
      Console.WriteLine(c3);
   }
}
// The example displays the following output:
//       (NaN, NaN)
//       (NaN, NaN)
//       (NaN, Infinity)
//       (NaN, Infinity)
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim c1 As Complex = New Complex(Double.MaxValue / 2, Double.MaxValue /2)

      Dim c2 As Complex = c1 / Complex.Zero
      Console.WriteLine(c2.ToString())
      c2 = c2 * New Complex(1.5, 1.5)
      Console.WriteLine(c2.ToString())
      Console.WriteLine()
      
      Dim c3 As Complex = c1 * New Complex(2.5, 3.5)
      Console.WriteLine(c3.ToString())
      c3 = c3 + New Complex(Double.MinValue / 2, Double.MaxValue / 2) 
      Console.WriteLine(c3)     
   End Sub
End Module
' The example displays the following output:
'       (NaN, NaN)
'       (NaN, NaN)
'
'       (NaN, Infinity)
'       (NaN, Infinity)

具有無效或溢位Double資料類型範圍之複數的數學運算不會擲回例外狀況。Mathematical operations with complex numbers that are invalid or that overflow the range of the Double data type do not throw an exception. 相反地, 它們會Double.PositiveInfinityDouble.NegativeInfinity下列情況Double.NaN下傳回、或:Instead, they return a Double.PositiveInfinity, Double.NegativeInfinity, or Double.NaN under the following conditions:

請注意, 這適用于方法所執行的任何中繼計算。Note that this applies to any intermediate calculations performed by a method. 例如, 的乘法new Complex(9e308, 9e308) and new Complex(2.5, 3.5)會使用公式 (ac-bd) + (ad + bc) i。For example, the multiplication of new Complex(9e308, 9e308) and new Complex(2.5, 3.5) uses the formula (ac - bd) + (ad + bc)i. 乘法所產生的實際元件計算會評估 expression 9e308 * 2.5-9e308 * 3.5。The calculation of the real component that results from the multiplication evaluates the expression 9e308 * 2.5 - 9e308 * 3.5. 此運算式Double.PositiveInfinity中的每個中繼乘法都會傳回, 而嘗試從傳回Double.NaNDouble.PositiveInfinity減去Double.PositiveInfinityEach intermediate multiplication in this expression returns Double.PositiveInfinity, and the attempt to subtract Double.PositiveInfinity from Double.PositiveInfinity returns Double.NaN.

格式化複數Formatting a Complex Number

根據預設, 複數的字串表示會採用real , )數形式(, 其中real虛部都是的字串標記法Double 。形成複數實際和虛陣列件的值。By default, the string representation of a complex number takes the form (real, imaginary), where real and imaginary are the string representations of the Double values that form the complex number's real and imaginary components. 方法的某些多載可讓您自訂這些Double值的字串表示, 以反映特定文化特性的格式設定慣例, 或以標準或自訂數值所定義的特定格式來顯示ToString格式字串。Some overloads of the ToString method allow customization of the string representations of these Double values to reflect the formatting conventions of a particular culture or to appear in a particular format defined by a standard or custom numeric format string. (如需詳細資訊, 請參閱標準數值格式字串自訂數值格式字串。)(For more information, see Standard Numeric Format Strings and Custom Numeric Format Strings.)

表示複數字串表示的其中一個比較常見的方式, 是使用 a + bi 形式, 其中 a 是複數的 real 元件, 而 b 是複數的虛數部分。One of the more common ways of expressing the string representation of a complex number takes the form a + bi, where a is the complex number's real component, and b is the complex number's imaginary component. 在電氣工程中, 複數最常以 + bj 表示。In electrical engineering, a complex number is most commonly expressed as a + bj. 您可以使用這兩種形式的其中一種, 傳回復數的字串標記法。You can return the string representation of a complex number in either of these two forms. 若要這麼做, 請藉由執行ICustomFormatterIFormatProvider介面來定義自訂格式提供者String.Format(IFormatProvider, String, Object[]) , 然後再呼叫方法。To do this, define a custom format provider by implementing the ICustomFormatter and IFormatProvider interfaces, and then call the String.Format(IFormatProvider, String, Object[]) method.

下列範例會定義一個ComplexFormatter類別, 它會以 + bi 或 + bj 的形式, 將複數表示為字串。The following example defines a ComplexFormatter class that represents a complex number as a string in the form of either a + bi or a + bj.

using System;
using System.Numerics;

public class ComplexFormatter :IFormatProvider, ICustomFormatter
{
   public object GetFormat(Type formatType) 
   {   
      if (formatType == typeof(ICustomFormatter))
         return this;
      else
         return null;
   }
   
   public string Format(string format, object arg, 
                        IFormatProvider provider)
   {
      if (arg is Complex)
      {
         Complex c1 = (Complex) arg; 
         // Check if the format string has a precision specifier.
         int precision;
         string fmtString = String.Empty;
         if (format.Length > 1) {
            try {
               precision = Int32.Parse(format.Substring(1));
            }
            catch (FormatException) {
               precision = 0;
            }
            fmtString = "N" + precision.ToString();
         }
         if (format.Substring(0, 1).Equals("I", StringComparison.OrdinalIgnoreCase))
            return c1.Real.ToString(fmtString) + " + " + c1.Imaginary.ToString(fmtString) + "i";
         else if (format.Substring(0, 1).Equals("J", StringComparison.OrdinalIgnoreCase))
            return c1.Real.ToString(fmtString) + " + " + c1.Imaginary.ToString(fmtString) + "j";
         else
            return c1.ToString(format, provider);
      }
      else
      {
         if (arg is IFormattable)
            return ((IFormattable) arg).ToString(format, provider);
         else if (arg != null) 
            return arg.ToString();
         else
            return String.Empty;
      }                        
   }
}
Imports System.Numerics

Public Class ComplexFormatter 
             Implements IFormatProvider, ICustomFormatter
   
   Public Function GetFormat(formatType As Type) As Object _
                   Implements IFormatProvider.GetFormat
      If formatType Is GetType(ICustomFormatter) Then
         Return Me
      Else
         Return Nothing
      End If
   End Function
   
   Public Function Format(fmt As String, arg As Object, 
                          provider As IFormatProvider) As String _
                   Implements ICustomFormatter.Format
      If TypeOf arg Is Complex Then
         Dim c1 As Complex = DirectCast(arg, Complex)
         ' Check if the format string has a precision specifier.
         Dim precision As Integer
         Dim fmtString As String = String.Empty
         If fmt.Length > 1 Then
            Try
               precision = Int32.Parse(fmt.Substring(1))
            Catch e As FormatException
               precision = 0
            End Try
            fmtString = "N" + precision.ToString()
         End If
         If fmt.Substring(0, 1).Equals("I", StringComparison.OrdinalIgnoreCase) Then
            Return c1.Real.ToString(fmtString) + " + " + c1.Imaginary.ToString(fmtString) + "i"
         ElseIf fmt.Substring(0, 1).Equals("J", StringComparison.OrdinalIgnoreCase) Then
            Return c1.Real.ToString(fmtString) + " + " + c1.Imaginary.ToString(fmtString) + "j"
         Else
            Return c1.ToString(fmt, provider)
         End If
      Else
         If Typeof arg Is IFormattable Then
            Return DirectCast(arg, IFormattable).ToString(fmt, provider)
         ElseIf arg IsNot Nothing Then
            Return arg.ToString()
         Else
            Return String.Empty
         End If   
      End If                        
   End Function
End Class

接著, 下列範例會使用這個自訂格式器顯示覆數的字串表示。The following example then uses this custom formatter to display the string representation of a complex number.

public class Example
{
   public static void Main()
   {
      Complex c1 = new Complex(12.1, 15.4);
      Console.WriteLine("Formatting with ToString():       " + 
                        c1.ToString());
      Console.WriteLine("Formatting with ToString(format): " + 
                        c1.ToString("N2"));
      Console.WriteLine("Custom formatting with I0:        " + 
                        String.Format(new ComplexFormatter(), "{0:I0}", c1));
      Console.WriteLine("Custom formatting with J3:        " + 
                        String.Format(new ComplexFormatter(), "{0:J3}", c1));
   }
}
// The example displays the following output:
//    Formatting with ToString():       (12.1, 15.4)
//    Formatting with ToString(format): (12.10, 15.40)
//    Custom formatting with I0:        12 + 15i
//    Custom formatting with J3:        12.100 + 15.400j
Module Example
   Public Sub Main()
      Dim c1 As Complex = New Complex(12.1, 15.4)
      Console.WriteLine("Formatting with ToString():       " + 
                        c1.ToString())
      Console.WriteLine("Formatting with ToString(format): " + 
                        c1.ToString("N2"))
      Console.WriteLine("Custom formatting with I0:        " + 
                        String.Format(New ComplexFormatter(), "{0:I0}", c1))
      Console.WriteLine("Custom formatting with J3:        " + 
                        String.Format(New ComplexFormatter(), "{0:J3}", c1))
   End Sub
End Module
' The example displays the following output:
'    Formatting with ToString():       (12.1, 15.4)
'    Formatting with ToString(format): (12.10, 15.40)
'    Custom formatting with I0:        12 + 15i
'    Custom formatting with J3:        12.100 + 15.400j

建構函式

Complex(Double, Double) Complex(Double, Double) Complex(Double, Double) Complex(Double, Double)

使用指定的實數和虛數,初始化 Complex 結構的新執行個體。Initializes a new instance of the Complex structure using the specified real and imaginary values.

欄位

ImaginaryOne ImaginaryOne ImaginaryOne ImaginaryOne

在實數等於零且虛數等於一條件下,傳回新 Complex 執行個體。Returns a new Complex instance with a real number equal to zero and an imaginary number equal to one.

Infinity Infinity Infinity Infinity

將無限大表示為複數。Represents infinity as a complex number.

NaN NaN NaN NaN

表示不是數字 (NaN) 的複雜執行個體。Represents a complex instance that is not a number (NaN).

One One One One

在實數等於一且虛數等於零條件下,傳回新 Complex 執行個體。Returns a new Complex instance with a real number equal to one and an imaginary number equal to zero.

Zero Zero Zero Zero

在實數等於零且虛數等於零條件下,傳回新 Complex 執行個體。Returns a new Complex instance with a real number equal to zero and an imaginary number equal to zero.

屬性

Imaginary Imaginary Imaginary Imaginary

取得目前 Complex 物件的虛數部分。Gets the imaginary component of the current Complex object.

Magnitude Magnitude Magnitude Magnitude

取得複數的範圍 (或絕對值)。Gets the magnitude (or absolute value) of a complex number.

Phase Phase Phase Phase

取得複數的階段。Gets the phase of a complex number.

Real Real Real Real

取得目前 Complex 物件的實數部分。Gets the real component of the current Complex object.

方法

Abs(Complex) Abs(Complex) Abs(Complex) Abs(Complex)

取得複數的絕對值 (或範圍)。Gets the absolute value (or magnitude) of a complex number.

Acos(Complex) Acos(Complex) Acos(Complex) Acos(Complex)

傳回角度,這個角度是指定之複數的反餘弦值。Returns the angle that is the arc cosine of the specified complex number.

Add(Double, Complex) Add(Double, Complex) Add(Double, Complex) Add(Double, Complex)

將雙精確度實數與複數相加,並傳回結果。Adds a double-precision real number to a complex number and returns the result.

Add(Complex, Double) Add(Complex, Double) Add(Complex, Double) Add(Complex, Double)

將複數與雙精確度實數相加,並傳回結果。Adds a complex number to a double-precision real number and returns the result.

Add(Complex, Complex) Add(Complex, Complex) Add(Complex, Complex) Add(Complex, Complex)

兩個複數相加,並傳回結果。Adds two complex numbers and returns the result.

Asin(Complex) Asin(Complex) Asin(Complex) Asin(Complex)

傳回角度,這個角度是指定之複數的反正弦值。Returns the angle that is the arc sine of the specified complex number.

Atan(Complex) Atan(Complex) Atan(Complex) Atan(Complex)

傳回角度,這個角度是指定之複數的反正切值。Returns the angle that is the arc tangent of the specified complex number.

Conjugate(Complex) Conjugate(Complex) Conjugate(Complex) Conjugate(Complex)

計算複數的共軛,並傳回結果。Computes the conjugate of a complex number and returns the result.

Cos(Complex) Cos(Complex) Cos(Complex) Cos(Complex)

傳回指定複數的餘弦函數。Returns the cosine of the specified complex number.

Cosh(Complex) Cosh(Complex) Cosh(Complex) Cosh(Complex)

傳回指定複數的雙曲餘弦。Returns the hyperbolic cosine of the specified complex number.

Divide(Double, Complex) Divide(Double, Complex) Divide(Double, Complex) Divide(Double, Complex)

將一個雙精確度實數除以複數,並傳回結果。Divides one double-precision real number by a complex number and returns the result.

Divide(Complex, Double) Divide(Complex, Double) Divide(Complex, Double) Divide(Complex, Double)

將一個複數除以雙精確度實數,並傳回結果。Divides one complex number by a double-precision real number and returns the result.

Divide(Complex, Complex) Divide(Complex, Complex) Divide(Complex, Complex) Divide(Complex, Complex)

以某複數除以另一個複數,並傳回結果。Divides one complex number by another and returns the result.

Equals(Complex) Equals(Complex) Equals(Complex) Equals(Complex)

傳回值,這個值指出目前執行個體和指定複數是否有相同的值。Returns a value that indicates whether the current instance and a specified complex number have the same value.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

傳回值,這個值表示目前執行個體與指定的物件是否有相同的值。Returns a value that indicates whether the current instance and a specified object have the same value.

Exp(Complex) Exp(Complex) Exp(Complex) Exp(Complex)

傳回乘至複數指定乘冪的 eReturns e raised to the power specified by a complex number.

FromPolarCoordinates(Double, Double) FromPolarCoordinates(Double, Double) FromPolarCoordinates(Double, Double) FromPolarCoordinates(Double, Double)

由點的極座標建立複數。Creates a complex number from a point's polar coordinates.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

傳回目前 Complex 物件的雜湊碼。Returns the hash code for the current Complex object.

IsFinite(Complex) IsFinite(Complex) IsFinite(Complex) IsFinite(Complex)

判斷指定的複數是否為有限大。Determines whether the specified complex number is finite.

IsInfinity(Complex) IsInfinity(Complex) IsInfinity(Complex) IsInfinity(Complex)

傳回值,指出指定的複數是否計算結果為無限大。Returns a value indicating whether the specified complex number evaluates to infinity.

IsNaN(Complex) IsNaN(Complex) IsNaN(Complex) IsNaN(Complex)

傳回值,該值表示指定的複雜執行個體是否不是數字 (NaN)。Returns a value that indicates whether the specified complex instance is not a number (NaN).

Log(Complex) Log(Complex) Log(Complex) Log(Complex)

傳回指定複數的自然 (底數 e) 對數。Returns the natural (base e) logarithm of a specified complex number.

Log(Complex, Double) Log(Complex, Double) Log(Complex, Double) Log(Complex, Double)

傳回指定底數中指定複數的對數。Returns the logarithm of a specified complex number in a specified base.

Log10(Complex) Log10(Complex) Log10(Complex) Log10(Complex)

傳回指定複數底數為 10 的對數。Returns the base-10 logarithm of a specified complex number.

Multiply(Complex, Complex) Multiply(Complex, Complex) Multiply(Complex, Complex) Multiply(Complex, Complex)

傳回兩個複數的乘積。Returns the product of two complex numbers.

Multiply(Double, Complex) Multiply(Double, Complex) Multiply(Double, Complex) Multiply(Double, Complex)

傳回雙精確度實數和複數的乘積。Returns the product of a double-precision real number and a complex number.

Multiply(Complex, Double) Multiply(Complex, Double) Multiply(Complex, Double) Multiply(Complex, Double)

傳回複數和雙精確度實數的乘積。Returns the product of a complex number and a double-precision real number.

Negate(Complex) Negate(Complex) Negate(Complex) Negate(Complex)

傳回指定之複數的加法反元素。Returns the additive inverse of a specified complex number.

Pow(Complex, Double) Pow(Complex, Double) Pow(Complex, Double) Pow(Complex, Double)

傳回指定之複數自乘至雙精確度浮點數指定之乘冪的結果。Returns a specified complex number raised to a power specified by a double-precision floating-point number.

Pow(Complex, Complex) Pow(Complex, Complex) Pow(Complex, Complex) Pow(Complex, Complex)

傳回指定的複數自乘至複數指定之乘冪的結果。Returns a specified complex number raised to a power specified by a complex number.

Reciprocal(Complex) Reciprocal(Complex) Reciprocal(Complex) Reciprocal(Complex)

傳回複數的乘法逆元。Returns the multiplicative inverse of a complex number.

Sin(Complex) Sin(Complex) Sin(Complex) Sin(Complex)

傳回指定複數的正弦函數。Returns the sine of the specified complex number.

Sinh(Complex) Sinh(Complex) Sinh(Complex) Sinh(Complex)

傳回指定複數的雙曲正弦。Returns the hyperbolic sine of the specified complex number.

Sqrt(Complex) Sqrt(Complex) Sqrt(Complex) Sqrt(Complex)

傳回指定複數的平方根。Returns the square root of a specified complex number.

Subtract(Double, Complex) Subtract(Double, Complex) Subtract(Double, Complex) Subtract(Double, Complex)

從雙精確度實數減去一個複數,並傳回結果。Subtracts one complex number from a double-precision real number and returns the result.

Subtract(Complex, Double) Subtract(Complex, Double) Subtract(Complex, Double) Subtract(Complex, Double)

從複數減去一個雙精確度實數,並傳回結果。Subtracts one double-precision real number from a complex number and returns the result.

Subtract(Complex, Complex) Subtract(Complex, Complex) Subtract(Complex, Complex) Subtract(Complex, Complex)

從某複數減去另一個複數,並傳回結果。Subtracts one complex number from another and returns the result.

Tan(Complex) Tan(Complex) Tan(Complex) Tan(Complex)

傳回指定複數的正切函數。Returns the tangent of the specified complex number.

Tanh(Complex) Tanh(Complex) Tanh(Complex) Tanh(Complex)

傳回指定複數的雙曲正切。Returns the hyperbolic tangent of the specified complex number.

ToString() ToString() ToString() ToString()

將目前複數的值轉換為直角座標形式 (Cartesian form) 的相等字串表示。Converts the value of the current complex number to its equivalent string representation in Cartesian form.

ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider) ToString(IFormatProvider)

使用指定文化特性格式資訊,將目前的複數值轉換為採取直角座標形式 (Cartesian form) 的相等字串表示。Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified culture-specific formatting information.

ToString(String) ToString(String) ToString(String) ToString(String)

使用實數及虛數格式的指定格式,將目前的複數值轉換為採取直角座標形式 (Cartesian form) 的相等字串表示。Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format for its real and imaginary parts.

ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider) ToString(String, IFormatProvider)

使用指定格式以及文化特性格式資訊來組成實數及虛數,將目前的複數值轉換為採取直角座標形式 (Cartesian form) 的相等字串表示。Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format and culture-specific format information for its real and imaginary parts.

運算子

Addition(Complex, Complex) Addition(Complex, Complex) Addition(Complex, Complex) Addition(Complex, Complex)

將兩個複數相加。Adds two complex numbers.

Addition(Double, Complex) Addition(Double, Complex) Addition(Double, Complex) Addition(Double, Complex)

將雙精確度實數與複數相加。Adds a double-precision real number to a complex number.

Addition(Complex, Double) Addition(Complex, Double) Addition(Complex, Double) Addition(Complex, Double)

將複數與雙精確度實數相加。Adds a complex number to a double-precision real number.

Division(Complex, Complex) Division(Complex, Complex) Division(Complex, Complex) Division(Complex, Complex)

以某指定複數除以另一個指定複數。Divides a specified complex number by another specified complex number.

Division(Complex, Double) Division(Complex, Double) Division(Complex, Double) Division(Complex, Double)

將指定的複數除以指定的雙精確度實數。Divides a specified complex number by a specified double-precision real number.

Division(Double, Complex) Division(Double, Complex) Division(Double, Complex) Division(Double, Complex)

將指定的雙精確度實數除以指定的複數。Divides a specified double-precision real number by a specified complex number.

Equality(Complex, Complex) Equality(Complex, Complex) Equality(Complex, Complex) Equality(Complex, Complex)

傳回值,這個值表示兩個複數是否相等。Returns a value that indicates whether two complex numbers are equal.

Explicit(Decimal to Complex) Explicit(Decimal to Complex) Explicit(Decimal to Complex) Explicit(Decimal to Complex)

定義從 Decimal 值到複數的明確轉換。Defines an explicit conversion of a Decimal value to a complex number.

Explicit(BigInteger to Complex) Explicit(BigInteger to Complex) Explicit(BigInteger to Complex) Explicit(BigInteger to Complex)

定義從 BigInteger 值到複數的明確轉換。Defines an explicit conversion of a BigInteger value to a complex number.

Implicit(UInt64 to Complex) Implicit(UInt64 to Complex) Implicit(UInt64 to Complex) Implicit(UInt64 to Complex)

定義從 64 位元不帶正負號整數到複數的隱含轉換。Defines an implicit conversion of a 64-bit unsigned integer to a complex number.

此應用程式開發介面不符合 CLS 標準。This API is not CLS-compliant.

Implicit(UInt32 to Complex) Implicit(UInt32 to Complex) Implicit(UInt32 to Complex) Implicit(UInt32 to Complex)

定義從 32 位元不帶正負號整數到複數的隱含轉換。Defines an implicit conversion of a 32-bit unsigned integer to a complex number.

此應用程式開發介面不符合 CLS 標準。This API is not CLS-compliant.

Implicit(UInt16 to Complex) Implicit(UInt16 to Complex) Implicit(UInt16 to Complex) Implicit(UInt16 to Complex)

定義從 16 位元不帶正負號整數到複數的隱含轉換。Defines an implicit conversion of a 16-bit unsigned integer to a complex number.

此應用程式開發介面不符合 CLS 標準。This API is not CLS-compliant.

Implicit(Single to Complex) Implicit(Single to Complex) Implicit(Single to Complex) Implicit(Single to Complex)

定義從單精確度浮點數到複數的隱含轉換。Defines an implicit conversion of a single-precision floating-point number to a complex number.

Implicit(SByte to Complex) Implicit(SByte to Complex) Implicit(SByte to Complex) Implicit(SByte to Complex)

定義從帶正負號的位元組到複數的隱含轉換。Defines an implicit conversion of a signed byte to a complex number.

此應用程式開發介面不符合 CLS 標準。This API is not CLS-compliant.

Implicit(Int32 to Complex) Implicit(Int32 to Complex) Implicit(Int32 to Complex) Implicit(Int32 to Complex)

定義從 32 位元帶正負號整數到複數的隱含轉換。Defines an implicit conversion of a 32-bit signed integer to a complex number.

Implicit(Int16 to Complex) Implicit(Int16 to Complex) Implicit(Int16 to Complex) Implicit(Int16 to Complex)

定義從 16 位元帶正負號整數到複數的隱含轉換。Defines an implicit conversion of a 16-bit signed integer to a complex number.

Implicit(Double to Complex) Implicit(Double to Complex) Implicit(Double to Complex) Implicit(Double to Complex)

定義從雙精確度浮點數到複數的隱含轉換。Defines an implicit conversion of a double-precision floating-point number to a complex number.

Implicit(Byte to Complex) Implicit(Byte to Complex) Implicit(Byte to Complex) Implicit(Byte to Complex)

定義從不帶正負號的位元組到複數的隱含轉換。Defines an implicit conversion of an unsigned byte to a complex number.

Implicit(Int64 to Complex) Implicit(Int64 to Complex) Implicit(Int64 to Complex) Implicit(Int64 to Complex)

定義從 64 位元帶正負號整數到複數的隱含轉換。Defines an implicit conversion of a 64-bit signed integer to a complex number.

Inequality(Complex, Complex) Inequality(Complex, Complex) Inequality(Complex, Complex) Inequality(Complex, Complex)

傳回值,這個值表示兩個複數是否不相等。Returns a value that indicates whether two complex numbers are not equal.

Multiply(Complex, Complex) Multiply(Complex, Complex) Multiply(Complex, Complex) Multiply(Complex, Complex)

乘上兩個指定的複數。Multiplies two specified complex numbers.

Multiply(Double, Complex) Multiply(Double, Complex) Multiply(Double, Complex) Multiply(Double, Complex)

將指定的雙精確度實數乘以指定的複數。Multiplies a specified double-precision real number by a specified complex number.

Multiply(Complex, Double) Multiply(Complex, Double) Multiply(Complex, Double) Multiply(Complex, Double)

將指定的複數乘以指定的雙精確度實數。Multiplies the specified complex number by a specified double-precision real number.

Subtraction(Complex, Complex) Subtraction(Complex, Complex) Subtraction(Complex, Complex) Subtraction(Complex, Complex)

從另一個複數減去一個複數。Subtracts a complex number from another complex number.

Subtraction(Complex, Double) Subtraction(Complex, Double) Subtraction(Complex, Double) Subtraction(Complex, Double)

從複數減去一個雙精確度實數。Subtracts a double-precision real number from a complex number.

Subtraction(Double, Complex) Subtraction(Double, Complex) Subtraction(Double, Complex) Subtraction(Double, Complex)

從雙精確度實數減去複數。Subtracts a complex number from a double-precision real number.

UnaryNegation(Complex) UnaryNegation(Complex) UnaryNegation(Complex) UnaryNegation(Complex)

傳回指定之複數的加法反元素。Returns the additive inverse of a specified complex number.

適用於