Complex.Add Complex.Add Complex.Add Complex.Add Method

定義

指定した数値を、指定した別の数値に加算します。数値の少なくとも 1 つは複素数であり、他の数値には倍精度実数を使用できます。Adds a specified number to another specified number, where at least one of them is a complex number, and the other could be a double-precision real 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)

2 つの複素数を加算し、その結果を返します。Adds two complex numbers and returns the result.

複素数を使用した加算の例を次に示します。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, 
                              Complex.Add(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, 
                              Complex.Add(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)

注釈

メソッドAddを使用すると、複雑な数値を含む加算演算を実行できます。The Add methods allow performing addition operations that involve complex numbers.

メソッド呼び出しによって、実数または虚数コンポーネントのいずれかでオーバーフローが発生した場合、コンポーネントDouble.PositiveInfinityDouble.NegativeInfinity値はまたはになります。If the method call results in an overflow in either the real or imaginary component, the value of the component is either Double.PositiveInfinity or Double.NegativeInfinity.

カスタム演算子をサポートしない言語では、 Addメソッドを使用して複素数の加算を実行できます。Languages that do not support custom operators can use the Add method to perform addition with complex numbers.

1 Addつの double を受け取るメソッドは、2つの複素数を受け取るメソッドよりも効率的です。The Add methods that receive one double are more efficient than the methods that receive two complex numbers.

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.

public:
 static System::Numerics::Complex Add(double left, System::Numerics::Complex right);
public static System.Numerics.Complex Add (double left, System.Numerics.Complex right);
static member Add : double * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Add (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.

注釈

実数 (複素数 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

こちらもご覧ください

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.

public:
 static System::Numerics::Complex Add(System::Numerics::Complex left, double right);
public static System.Numerics.Complex Add (System.Numerics.Complex left, double right);
static member Add : System.Numerics.Complex * double -> System.Numerics.Complex
Public Shared Function Add (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.

注釈

複素数 (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

こちらもご覧ください

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

2 つの複素数を加算し、その結果を返します。Adds two complex numbers and returns the result.

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

パラメーター

left
Complex Complex Complex Complex

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

right
Complex Complex Complex Complex

加算する 2 番目の複素数。The second complex number 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.

こちらもご覧ください

適用対象