C# Complex Divide

Description

Complex Divide Divides one complex number by another and returns the result.

Syntax

Complex.Divide has the following syntax.


public static Complex Divide(
  Complex dividend,
  Complex divisor
)

Parameters

Complex.Divide has the following parameters.

  • dividend - The complex number to be divided.
  • divisor - The complex number to divide by.

Returns

Complex.Divide method returns The quotient of the division.

Example

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


//from   w ww  .  j av a  2 s  .c  o m
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 code above generates the following result.





















Home »
  C# Tutorial »
    System.Numerics »




BigInteger
Complex