mindaslab.Math
Class Complex

java.lang.Object
  extended by mindaslab.Math.Complex

public class Complex
extends java.lang.Object

Created to perform arithmetic on complex numbers


Constructor Summary
Complex()
          Creates a new instance of Complex 0 + 0 j
Complex(Complex c)
          Creates a new instance of Complex which has same proprties of passing Complex number
Complex(double real, double imaginary)
          Creates a new instance of Complex (real + imaginary j)
 
Method Summary
 Complex add(Complex c)
          Adds two complex numbers
 Complex conjucate()
          Finds the conjucate of a complex number
 Complex divide(Complex c)
          Divides two complex numbers
 double getAngle()
          Returns polar angle of the complex nmber
 double getMagnitude()
          Returns the polar magnitude of the complex number
 Complex inverse()
          Gets the inverse of complex number
 Complex multiply(Complex c)
          Multiplies two complex numbers to give third one
 void setPolar(double magnitude, double angle)
          Allows one to set complex number in polar form The angle is in radians
 Complex subract(Complex c)
          Subtacts two complex numbers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Complex

public Complex()
Creates a new instance of Complex 0 + 0 j


Complex

public Complex(double real,
               double imaginary)
Creates a new instance of Complex (real + imaginary j)


Complex

public Complex(Complex c)
Creates a new instance of Complex which has same proprties of passing Complex number

Method Detail

setPolar

public void setPolar(double magnitude,
                     double angle)
Allows one to set complex number in polar form The angle is in radians


getMagnitude

public double getMagnitude()
Returns the polar magnitude of the complex number


getAngle

public double getAngle()
Returns polar angle of the complex nmber


add

public Complex add(Complex c)
Adds two complex numbers


subract

public Complex subract(Complex c)
Subtacts two complex numbers


conjucate

public Complex conjucate()
Finds the conjucate of a complex number


multiply

public Complex multiply(Complex c)
Multiplies two complex numbers to give third one


inverse

public Complex inverse()
Gets the inverse of complex number


divide

public Complex divide(Complex c)
Divides two complex numbers