kao.math.Complex Class Reference

A Complex number implementation. More...

List of all members.

Public Member Functions

 Complex (double re, double im)
 Create a new Complex number.
Complex add (Complex x)
 Complex number addition.
Complex sub (Complex x)
 Complex number subtraction.
Complex mult (Complex x)
 Complex number multiplication.
Complex mult (double r)
 Complex number multiplication.
Complex div (Complex x)
 Complex number division.
Complex div (double r)
 Complex number division.
Complex exp ()
 Calculates the exponential of this Complex number.
Complex pow (double n)
 Calculates the this Complex number to the power of n.
Complex pow (int n)
 Calculates the this Complex number to the power of n.
Complex conj ()
 Calculates the conjugate of this Complex number.
double complexConj ()
 Calculate the complex conjugate of this Complex number.
double modulus ()
 Calculate the modulus of this Complex number.
double getRe ()
 Return the real part of this Complex number.
double getIm ()
 Return the imaginary part of this Complex number.
void setRe (double re)
 Set the real part of this Complex number.
void setIm (double im)
 Set the imaginary part of this Complex number.

Detailed Description

A Complex number implementation.

A Complex number as defined by:

\[ x = a + b i \]

Author:
David Kao

Constructor & Destructor Documentation

kao.math.Complex.Complex ( double  re,
double  im 
)

Create a new Complex number.

Parameters:
re Real part of Complex number
im Imaginary part of Complex number
Author:
David Kao

Member Function Documentation

Complex kao.math.Complex.add ( Complex  x  ) 

Complex number addition.

Add Complex number x to this Complex number.

Parameters:
x Complex number
Returns:
Result of Complex number addition.
Author:
David Kao
double kao.math.Complex.complexConj (  ) 

Calculate the complex conjugate of this Complex number.

Returns:
Complex conjugate.
Author:
David Kao
Complex kao.math.Complex.conj (  ) 

Calculates the conjugate of this Complex number.

Returns:
The conjugate of this Complex number.
Author:
David Kao
Complex kao.math.Complex.div ( double  r  ) 

Complex number division.

Divides this Complex number with a real number r.

Parameters:
r Real number
Returns:
Result of Complex number/Real number division.
Author:
David Kao
Complex kao.math.Complex.div ( Complex  x  ) 

Complex number division.

Divides this Complex number with x.

Parameters:
x Complex number
Returns:
Result of Complex number division.
Author:
David Kao
Complex kao.math.Complex.exp (  ) 

Calculates the exponential of this Complex number.

Returns:
The exponential of this Complex number.
Author:
David Kao
double kao.math.Complex.getIm (  ) 

Return the imaginary part of this Complex number.

Returns:
Imaginary part of this Complex number
Author:
David Kao
double kao.math.Complex.getRe (  ) 

Return the real part of this Complex number.

Returns:
Real part of this Complex number
Author:
David Kao
double kao.math.Complex.modulus (  ) 

Calculate the modulus of this Complex number.

Returns:
Modulus
Author:
David Kao
Complex kao.math.Complex.mult ( double  r  ) 

Complex number multiplication.

Multiplies this Complex number with a real number r.

Parameters:
r Real number
Returns:
Result of Complex number/Real number multiplication.
Author:
David Kao
Complex kao.math.Complex.mult ( Complex  x  ) 

Complex number multiplication.

Multiplies this Complex number with x.

Parameters:
x Complex number
Returns:
Result of Complex number multiplication.
Author:
David Kao
Complex kao.math.Complex.pow ( int  n  ) 

Calculates the this Complex number to the power of n.

Parameters:
[in] n nth power
Returns:
This Complex number to the power of n.
Author:
David Kao
Complex kao.math.Complex.pow ( double  n  ) 

Calculates the this Complex number to the power of n.

Parameters:
[in] n nth power
Returns:
This Complex number to the power of n.
Author:
David Kao
void kao.math.Complex.setIm ( double  im  ) 

Set the imaginary part of this Complex number.

Parameters:
im Imaginary part of Complex number
Author:
David Kao
void kao.math.Complex.setRe ( double  re  ) 

Set the real part of this Complex number.

Parameters:
re Real part of Complex number
Author:
David Kao
Complex kao.math.Complex.sub ( Complex  x  ) 

Complex number subtraction.

Subtracts Complex number x from this Complex number.

Parameters:
x Complex number
Returns:
Result of Complex number subtraction.
Author:
David Kao

Generated on Wed Apr 21 22:01:41 2010 for kao-math by  doxygen 1.6.1