Complex.Divide Metod

Definition

Delar upp ett angivet tal med ett annat angivet tal, där minst ett av dem är ett komplext tal, och det andra kan vara ett reellt tal med dubbel precision.

Överlagringar

Name Description
Divide(Double, Complex)

Delar upp ett reellt tal med dubbel precision med ett komplext tal och returnerar resultatet.

Divide(Complex, Double)

Delar upp ett komplext tal med ett reellt tal med dubbel precision och returnerar resultatet.

Divide(Complex, Complex)

Delar upp ett komplext tal med ett annat och returnerar resultatet.

Exempel

I följande exempel delas ett komplext tal efter varje element i en matris med komplexa tal.

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

let c1 = Complex(1.2, 2.3);
let values = 
    [ Complex(1.2, 2.3)
      Complex(0.5, 0.75)
      Complex(3.0, -5.0) ]

for c2 in values do
    printfn $"{c1} / {c2} = {Complex.Divide(c1, c2):N2}"
// 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)

Kommentarer

Med Divide metoderna kan du utföra divisionsåtgärder som omfattar komplexa tal.

Om beräkningen av kvoten resulterar i ett spill i antingen den verkliga eller imaginära komponenten är värdet för komponenten antingen Double.PositiveInfinity eller Double.NegativeInfinity.

Metoden Divide kan användas av Språk som inte stöder anpassade operatorer. Dess beteende är identiskt med divisionen med hjälp av divisionsoperatorn.

De Divide metoder som tar emot en dubbel är mer effektiva än de metoder som tar emot två komplexa tal.

Divide(Double, Complex)

Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs

Delar upp ett reellt tal med dubbel precision med ett komplext tal och returnerar resultatet.

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

Parametrar

dividend
Double

Det reella talet med dubbel precision som ska delas.

divisor
Complex

Det komplexa tal som ska divideras med.

Returer

Uppdelningens kvot.

Kommentarer

Uppdelningen av ett verkligt tal (som kan betraktas som det komplexa talet a + 0i) och ett komplext tal (c + di) har följande form:

$\frac{ac}{c^2 + d^2} + (\frac{ad}{c^2 + d^2})i$

Se även

Gäller för

Divide(Complex, Double)

Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs

Delar upp ett komplext tal med ett reellt tal med dubbel precision och returnerar resultatet.

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

Parametrar

dividend
Complex

Det komplexa tal som ska delas.

divisor
Double

Det reella talet med dubbel precision som ska divideras med.

Returer

Uppdelningens kvot.

Kommentarer

Divisionen av ett komplext tal (a + bi) och ett verkligt tal (som kan betraktas som det komplexa talet c + 0i) har följande form:

$\frac{ac}{c^2} + (\frac{bc}{c^2})i$

Se även

Gäller för

Divide(Complex, Complex)

Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs
Källa:
Complex.cs

Delar upp ett komplext tal med ett annat och returnerar resultatet.

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

Parametrar

dividend
Complex

Det komplexa tal som ska delas.

divisor
Complex

Det komplexa tal som ska divideras med.

Returer

Uppdelningens kvot.

Kommentarer

Divisionen av ett komplext tal, a + bi, med ett andra komplext tal, c + di, har följande form:

$\frac{ac + bd}{c^2 + d^2} + (\frac{bc - ad}{c^2 + d^2})i$

Se även

Gäller för