Complex.Addition Complex.Addition Complex.Addition Complex.Addition Operator

定義

オーバーロード

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

2 つの複素数を加算します。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.

次の例は、複素数による加算を示しています。The following example illustrates addition with complex numbers:

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex[] values= { new Complex(12.3, -1.4), 
                          new Complex(-6.2, 3.1), 
                          new Complex(8.9, 1.5) };   
      foreach (var c1 in values)
         foreach (var c2 in values)
            Console.WriteLine("{0} + {1} = {2}", c1, c2, c1 + c2);
   }
}
// The example displays the following output:
//       (12.3, -1.4) + (12.3, -1.4) = (24.6, -2.8)
//       (12.3, -1.4) + (-6.2, 3.1) = (6.1, 1.7)
//       (12.3, -1.4) + (8.9, 1.5) = (21.2, 0.1)
//       (-6.2, 3.1) + (12.3, -1.4) = (6.1, 1.7)
//       (-6.2, 3.1) + (-6.2, 3.1) = (-12.4, 6.2)
//       (-6.2, 3.1) + (8.9, 1.5) = (2.7, 4.6)
//       (8.9, 1.5) + (12.3, -1.4) = (21.2, 0.1)
//       (8.9, 1.5) + (-6.2, 3.1) = (2.7, 4.6)
//       (8.9, 1.5) + (8.9, 1.5) = (17.8, 3)
Imports System.Numerics

Module modMain
   Public Sub Main()
      Dim values() As Complex = { New Complex(12.3, -1.4), 
                                  New Complex(-6.2, 3.1), 
                                  New Complex(8.9, 1.5) }   
      For Each c1 In values
         For Each c2 In values
            Console.WriteLine("{0} + {1} = {2}", c1, c2, c1 + c2)
         Next
      Next      
   End Sub
End Module
' The example displays the following output:
'       (12.3, -1.4) + (12.3, -1.4) = (24.6, -2.8)
'       (12.3, -1.4) + (-6.2, 3.1) = (6.1, 1.7)
'       (12.3, -1.4) + (8.9, 1.5) = (21.2, 0.1)
'       (-6.2, 3.1) + (12.3, -1.4) = (6.1, 1.7)
'       (-6.2, 3.1) + (-6.2, 3.1) = (-12.4, 6.2)
'       (-6.2, 3.1) + (8.9, 1.5) = (2.7, 4.6)
'       (8.9, 1.5) + (12.3, -1.4) = (21.2, 0.1)
'       (8.9, 1.5) + (-6.2, 3.1) = (2.7, 4.6)
'       (8.9, 1.5) + (8.9, 1.5) = (17.8, 3)

注釈

演算子Additionを使用すると、複雑な数値を含む加算演算を実行できます。The Addition operator allows performing addition operations that involve complex numbers. 次のようなコードが有効になります。It enables code such as the following:

Complex c1 = new Complex(1.2, 2.3);
Complex c2 = new Complex(2.1, 3.2);
Complex c3 = c1 + c2;
Dim c1 As New Complex(1.2, 2.3)
Dim c2 As New Complex(2.1, 3.2)
Dim c3 As Complex = c1 + c2

加算によって、実数または虚数のいずれかのコンポーネントでオーバーフローが発生した場合、 Double.PositiveInfinityそのDouble.NegativeInfinityコンポーネントの値はまたはになります。If the addition results in an overflow in either the real or imaginary component, the value of that component is either Double.PositiveInfinity or Double.NegativeInfinity.

カスタム演算子をサポートしない言語では、 Add代わりに同等のメソッドのグループを呼び出すことができます。Languages that do not support custom operators can call the Add equivalent group of methods instead.

1つの double を受け取る演算子は、2つの複素数を受け取る演算子よりも効率的です。AdditionThe Addition operators that receive one double are more efficient than the operators that receive two Complex numbers.

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

2 つの複素数を加算します。Adds two complex numbers.

public:
 static System::Numerics::Complex operator +(System::Numerics::Complex left, System::Numerics::Complex right);
public static System.Numerics.Complex operator + (System.Numerics.Complex left, System.Numerics.Complex right);
static member ( + ) : System.Numerics.Complex * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Operator + (left As Complex, right As Complex) As Complex

パラメーター

left
Complex Complex Complex Complex

加算する 1 つ目の複素数。The first complex value to add.

right
Complex Complex Complex Complex

加算する 2 つ目の複素数。The second complex value to add.

戻り値

leftright の合計。The sum of left and right.

注釈

複素数、a + bi、および2番目の複素数 (c + di) の追加には、次の形式があります。The addition of a complex number, a + bi, and a second complex number, c + di, takes the following form:

(a + c) + (b + d) i(a + c) + (b + d)i

カスタム演算子をサポートしない言語では、 Complex.Add(Complex, Double)代わりに同等のメソッドを呼び出すことができます。Languages that do not support custom operators can call the Complex.Add(Complex, Double) equivalent method instead.

こちらもご覧ください

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

倍精度実数を複素数に加算します。Adds a double-precision real number to a complex number.

public:
 static System::Numerics::Complex operator +(double left, System::Numerics::Complex right);
public static System.Numerics.Complex operator + (double left, System.Numerics.Complex right);
static member ( + ) : double * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Operator + (left As Double, right As Complex) As Complex

パラメーター

left
Double Double Double Double

加算する倍精度実数値。The double-precision real value to add.

right
Complex Complex Complex Complex

加算する複素数値。The complex value to add.

戻り値

複素数としての leftright の合計。The sum of left and right as a complex number.

注釈

実数 (複素数 a + 0i と見なすことができる) と複素数 (c + di) は、次のような形式になります。The addition of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form:

(a + c) + di(a + c) + di

カスタム演算子をサポートしない言語では、 Complex.Add(Double, Complex)代わりに同等のメソッドを呼び出すことができます。Languages that do not support custom operators can call the Complex.Add(Double, Complex) equivalent method instead.

こちらもご覧ください

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

複素数を倍精度実数に加算します。Adds a complex number to a double-precision real number.

public:
 static System::Numerics::Complex operator +(System::Numerics::Complex left, double right);
public static System.Numerics.Complex operator + (System.Numerics.Complex left, double right);
static member ( + ) : System.Numerics.Complex * double -> System.Numerics.Complex
Public Shared Operator + (left As Complex, right As Double) As Complex

パラメーター

left
Complex Complex Complex Complex

加算する複素数値。The complex value to add.

right
Double Double Double Double

加算する倍精度実数値。The double-precision real value to add.

戻り値

複素数としての leftright の合計。The sum of left and right as a complex number.

注釈

複素数 (a + bi) と実数 (複素数 c + 0i と見なすことができる) は、次のような形式になります。The addition of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form:

(a + c) + bi(a + c) + bi

カスタム演算子をサポートしない言語では、 Complex.Add(Double, Complex)代わりに同等のメソッドを呼び出すことができます。Languages that do not support custom operators can call the Complex.Add(Double, Complex) equivalent method instead.

こちらもご覧ください

適用対象