Complex.Subtract 方法

重载

 Subtract(Double, Complex) 一个双精度实数减一个复数，并返回结果。Subtracts one complex number from a double-precision real number and returns the result. Subtract(Complex, Double) 一个复数减一个双精度实数，并返回结果。Subtracts one double-precision real number from a complex number and returns the result. Subtract(Complex, Complex) 从一个复数中减去另一个复数并返回结果。Subtracts one complex number from another and returns the result.

示例

``````using System;
using System.Numerics;

public class Example
{
public static void Main()
{
Complex c1 = new Complex(4.93, 6.87);
Complex[] values = { new Complex(12.5, 9.6),
new Complex(4.3, -8.1),
new Complex(-1.9, 7.4),
new Complex(-5.3, -6.6) };

foreach (var c2 in values)
Console.WriteLine("{0} - {1} = {2}", c1, c2,
Complex.Subtract(c1, c2));
}
}
// The example displays the following output:
//       (4.93, 6.87) - (12.5, 9.6) = (-7.57, -2.73)
//       (4.93, 6.87) - (4.3, -8.1) = (0.63, 14.97)
//       (4.93, 6.87) - (-1.9, 7.4) = (6.83, -0.53)
//       (4.93, 6.87) - (-5.3, -6.6) = (10.23, 13.47)
``````
``````Imports System.Numerics

Module Example
Public Sub Main()
Dim c1 As New Complex(4.93, 6.87)
Dim values() As Complex = { New Complex(12.5, 9.6),
New Complex(4.3, -8.1),
New Complex(-1.9, 7.4),
New Complex(-5.3, -6.6) }

For Each c2 In values
Console.WriteLine("{0} - {1} = {2}", c1, c2,
Complex.Subtract(c1, c2))
Next
End Sub
End Module
' The example displays the following output:
'       (4.93, 6.87) - (12.5, 9.6) = (-7.57, -2.73)
'       (4.93, 6.87) - (4.3, -8.1) = (0.63, 14.97)
'       (4.93, 6.87) - (-1.9, 7.4) = (6.83, -0.53)
'       (4.93, 6.87) - (-5.3, -6.6) = (10.23, 13.47)
``````

注解

Subtract 方法允许包含复数的减法运算。The Subtract method allows subtraction operations that involve complex numbers.

Subtract(Double, Complex)

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

left
Double

right
Complex

返回

`right``left` 所得的结果（为复数）。The result of subtracting `right` from `left`, as a complex number.

注解

（c）-di(a - c) - di

Subtract(Complex, Double)

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

left
Complex

right
Double

返回

`right``left` 所得的结果（为复数）。The result of subtracting `right` from `left`, as a complex number.

注解

（c） + bi(a - c) + bi

Subtract(Complex, Complex)

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

left
Complex

right
Complex

返回

`right``left` 所得的结果。The result of subtracting `right` from `left`.

注解

（c） + （b-hli） i(a - c) + (b - d)i