Complex.Multiply Method

Definition

Multiplies a specified number by another specified number, where at least one of them is a complex number, and the other could be a double-precision real number.

Overloads

Multiply(Double, Complex)

Returns the product of a double-precision real number and a complex number.

Multiply(Complex, Double)

Returns the product of a complex number and a double-precision real number.

Multiply(Complex, Complex)

Returns the product of two complex numbers.

Examples

The following example multiples a complex number by each element in an array of complex numbers.

C#
using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex number1 = new Complex(8.3, 17.5);
      Complex[] numbers = { new Complex(1.4, 6.3),
                            new Complex(-2.7, 1.8),
                            new Complex(3.1, -2.1) };
      foreach (Complex number2 in numbers)
         Console.WriteLine("{0} x {1} = {2}", number1, number2,
                           Complex.Multiply(number1, number2));
   }
}
// The example displays the following output:
//       (8.3, 17.5) x (1.4, 6.3) = (-98.63, 76.79)
//       (8.3, 17.5) x (-2.7, 1.8) = (-53.91, -32.31)
//       (8.3, 17.5) x (3.1, -2.1) = (62.48, 36.82)

Remarks

The Multiply methods allow performing multiplication operations that involve complex numbers.

If the multiplication results in an overflow in either the real or imaginary component, the value of that component is either Double.PositiveInfinity or Double.NegativeInfinity.

The Multiply method is implemented for Languages that don't support custom operators. Its behavior is identical to multiplication using the multiplication operator.

Multiply(Double, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Returns the product of a double-precision real number and a complex number.

C#
public static System.Numerics.Complex Multiply(double left, System.Numerics.Complex right);

Parameters

left
Double

The double-precision real number to multiply.

right
Complex

The complex number to multiply.

Returns

The product of the left and right parameters.

Remarks

The multiplication of a real number (which can be regarded as the complex number a + 0i) and a complex number (c + di) takes the following form:

ac+adi

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

Multiply(Complex, Double)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Returns the product of a complex number and a double-precision real number.

C#
public static System.Numerics.Complex Multiply(System.Numerics.Complex left, double right);

Parameters

left
Complex

The complex number to multiply.

right
Double

The double-precision real number to multiply.

Returns

The product of the left and right parameters.

Remarks

The multiplication of a complex number (a + bi) and a real number (which can be regarded as the complex number c + 0i) takes the following form:

ac+bci

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10

Multiply(Complex, Complex)

Source:
Complex.cs
Source:
Complex.cs
Source:
Complex.cs

Returns the product of two complex numbers.

C#
public static System.Numerics.Complex Multiply(System.Numerics.Complex left, System.Numerics.Complex right);

Parameters

left
Complex

The first complex number to multiply.

right
Complex

The second complex number to multiply.

Returns

The product of the left and right parameters.

Remarks

The multiplication of a complex number, a + bi, and a second complex number, c + di, takes the following form:

(acbd)+(ad+bc)i

See also

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1
UWP 10.0