Complex.Multiply 方法

定义

将一个指定数字乘以另一个指定数字,其中至少有一个是复数,另一个可以是双精度实数。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.

重载

Multiply(Complex, Complex)

返回两个复数的乘积。Returns the product of two complex numbers.

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.

示例

下面的示例将一个复数与一个复数数组中的每个元素进行比较。The following example multiples a complex number by each element in an array of complex numbers.

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)
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim number1 As New Complex(8.3, 17.5)
      Dim numbers() As Complex = { New Complex(1.4, 6.3), 
                                   New Complex(-2.7, 1.8), 
                                   New Complex(3.1, -2.1) }
      For Each number2 In numbers
         Console.WriteLine("{0} x {1} = {2}", number1, number2, 
                           Complex.Multiply(number1, number2))
      Next
   End Sub
End Module
' 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)

注解

Multiply 方法允许执行涉及复数的乘法运算。The Multiply methods allow performing multiplication operations that involve complex numbers.

如果乘法导致实部或虚部溢出,则该组件的值为 Double.PositiveInfinityDouble.NegativeInfinityIf 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.

为不支持自定义运算符的语言实现 Multiply 方法。The Multiply method is implemented for languages that do not support custom operators. 它的行为与使用乘法运算符的乘法相同。Its behavior is identical to multiplication using the multiplication operator.

Multiply(Complex, Complex)

返回两个复数的乘积。Returns the product of two complex numbers.

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

参数

left
Complex

要相乘的第一个复数。The first complex number to multiply.

right
Complex

要相乘的第二个复数。The second complex number to multiply.

返回

leftright 参数的乘积。The product of the left and right parameters.

注解

复数、+ bi 和第二复数(c + di)的乘法采用以下形式:The multiplication of a complex number, a + bi, and a second complex number, c + di, takes the following form:

(ac-bd) + (ad + bc) i(ac - bd) + (ad + bc)i

另请参阅

Multiply(Double, Complex)

返回一个双精度实数与一个复数的乘积。Returns the product of a double-precision real number and a complex number.

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

参数

left
Double

要相乘的双精度实数。The double-precision real number to multiply.

right
Complex

要相乘的复数。The complex number to multiply.

返回

leftright 参数的乘积。The product of the left and right parameters.

注解

实数(可视为复数 a + 0 i)和复数(c + di)的乘法采用以下形式: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 + adiac + adi

另请参阅

Multiply(Complex, Double)

返回一个复数与一个双精度实数的乘积。Returns the product of a complex number and a double-precision real number.

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

参数

left
Complex

要相乘的复数。The complex number to multiply.

right
Double

要相乘的双精度实数。The double-precision real number to multiply.

返回

leftright 参数的乘积。The product of the left and right parameters.

注解

复数(a + bi)与实数(可视为复数 c + 0 i)的乘法采用以下形式: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 + bciac + bci

另请参阅

适用于