Complex.Divide 方法

定义

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

重载

Divide(Double, Complex)

将一个双精度实数除以一个复数,并返回结果。Divides one double-precision real number by a complex number and returns the result.

Divide(Complex, Double)

将一个复数除以一个双精度实数,并返回结果。Divides one complex number by a double-precision real number and returns the result.

Divide(Complex, Complex)

用一个复数除另一个复数并返回结果。Divides one complex number by another and returns the result.

示例

下面的示例将一个复数除以复数数组中的每个元素。The following example divides 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 c1 = new Complex(1.2, 2.3);
      Complex[] values = { new Complex(1.2, 2.3), 
                           new Complex(0.5, 0.75), 
                           new Complex(3.0, -5.0) };
      foreach (Complex c2 in values)
         Console.WriteLine("{0} / {1} = {2:N2}", c1, c2, 
                           Complex.Divide(c1, c2));
   }
}
// The example displays the following output:
//       (1.2, 2.3) / (1.2, 2.3) = (1.00, 0.00)
//       (1.2, 2.3) / (0.5, 0.75) = (2.86, 0.31)
//       (1.2, 2.3) / (3, -5) = (-0.23, 0.38)
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim c1 As New Complex(1.2, 2.3)
      Dim values() As Complex = { New Complex(1.2, 2.3), 
                                  New Complex(0.5, 0.75), 
                                  New Complex(3.0, -5.0) }
      For Each c2 In values
         Console.WriteLine("{0} / {1} = {2:N2}", c1, c2, 
                           Complex.Divide(c1, c2))
      Next
   End Sub
End Module
' The example displays the following output:
'       (1.2, 2.3) / (1.2, 2.3) = (1.00, 0.00)
'       (1.2, 2.3) / (0.5, 0.75) = (2.86, 0.31)
'       (1.2, 2.3) / (3, -5) = (-0.23, 0.38)

注解

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

如果商的计算导致实部或虚部溢出,则该组件的值为 Double.PositiveInfinityDouble.NegativeInfinityIf the calculation of the quotient results in an overflow in either the real or imaginary component, the value of that component is either Double.PositiveInfinity or Double.NegativeInfinity.

不支持自定义运算符的语言可以使用 Divide 方法。The Divide method can be used by languages that do not support custom operators. 其行为与使用除法运算符的除法相同。Its behavior is identical to division using the division operator.

接收一个 double 的 Divide 方法比接收两个复数的方法更有效。The Divide methods that receive one double are more efficient than the methods that receive two complex numbers.

Divide(Double, Complex)

将一个双精度实数除以一个复数,并返回结果。Divides one double-precision real number by a complex number and returns the result.

public:
 static System::Numerics::Complex Divide(double dividend, System::Numerics::Complex divisor);
public static System.Numerics.Complex Divide (double dividend, System.Numerics.Complex divisor);
static member Divide : double * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Divide (dividend As Double, divisor As Complex) As Complex

参数

dividend
Double

要作为被除数的双精度实数。The double-precision real number to be divided.

divisor
Complex

要作为除数的复数。The complex number to divide by.

返回

相除后的商。The quotient of the division.

注解

实数的相除(可视为复数 a + 0 i)和复数(c + di)采用以下形式:The division 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/(c2 + d2)) + (ad/(c2 + d2) i(ac / (c2 + d2)) + (ad / (c2 + d2)i

另请参阅

Divide(Complex, Double)

将一个复数除以一个双精度实数,并返回结果。Divides one complex number by a double-precision real number and returns the result.

public:
 static System::Numerics::Complex Divide(System::Numerics::Complex dividend, double divisor);
public static System.Numerics.Complex Divide (System.Numerics.Complex dividend, double divisor);
static member Divide : System.Numerics.Complex * double -> System.Numerics.Complex
Public Shared Function Divide (dividend As Complex, divisor As Double) As Complex

参数

dividend
Complex

要作为被除数的复数。The complex number to be divided.

divisor
Double

要作为除数的双精度实数。The double-precision real number to divide by.

返回

相除后的商。The quotient of the division.

注解

复数(a + bi)和实数(可视为复数 c + 0 i)的除法采用以下形式:The division 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/c2) + (bc/c2) i(ac / c2) + (bc / c2)i

另请参阅

Divide(Complex, Complex)

用一个复数除另一个复数并返回结果。Divides one complex number by another and returns the result.

public:
 static System::Numerics::Complex Divide(System::Numerics::Complex dividend, System::Numerics::Complex divisor);
public static System.Numerics.Complex Divide (System.Numerics.Complex dividend, System.Numerics.Complex divisor);
static member Divide : System.Numerics.Complex * System.Numerics.Complex -> System.Numerics.Complex
Public Shared Function Divide (dividend As Complex, divisor As Complex) As Complex

参数

dividend
Complex

要作为被除数的复数。The complex number to be divided.

divisor
Complex

要作为除数的复数。The complex number to divide by.

返回

相除后的商。The quotient of the division.

注解

复数的相除,+ bi 除以第二个复数,number,c + di,采用以下形式:The division of a complex number, a + bi, by a second complex number, number, c + di, takes the following form:

((ac + bd)/(c2 + d2)) + ((bc-ad)/(c2 + d2) i((ac + bd) / (c2 + d2)) + ((bc - ad) / (c2 + d2)i

另请参阅

适用于