jfract V1.0a

org.jfract.math
Class Complex

java.lang.Object
  |
  +--org.jfract.math.Complex
All Implemented Interfaces:
java.io.Serializable

public class Complex
extends java.lang.Object
implements java.io.Serializable

This class is used to modeling a complex number

See Also:
Serialized Form

Field Summary
(package private)  double Im
          The imaginary part of the complex
(package private)  double Re
          The Real part of the complex
 
Constructor Summary
Complex(double Re, double Im)
          The constructor
 
Method Summary
 Complex add(Complex Z)
          Add a complex
 Complex div(Complex Z)
          divide by a complex
 Complex div(double d)
          divide by a double
 double getIm()
          get the Im part
 double getRe()
          Get the real part
static Complex inverse(Complex C)
          inverse the complex
 Complex minus(Complex Z)
          minus a complex
 double mod()
           
 double mod2()
           
 Complex mul(Complex Z)
          Multiply by a complex
 Complex mul(double d)
          Multiply by a double
 Complex pow(int i)
          pow the complex
 void setIm(double Im)
          Set th im part
 void setRe(double Re)
          set the real part
 Complex sub(Complex Z)
          Substract a complex
 java.lang.String toString()
          get a string representation
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

Re

double Re
The Real part of the complex

Im

double Im
The imaginary part of the complex
Constructor Detail

Complex

public Complex(double Re,
               double Im)
The constructor
Parameters:
Re - the real part
Im - the im part
Method Detail

getRe

public double getRe()
Get the real part

getIm

public double getIm()
get the Im part

setRe

public void setRe(double Re)
set the real part

setIm

public void setIm(double Im)
Set th im part

mod

public double mod()

mod2

public double mod2()

add

public Complex add(Complex Z)
Add a complex
Parameters:
Z - the complex to add
Returns:
the result as a complex

minus

public Complex minus(Complex Z)
minus a complex
Parameters:
Z - the complex to add
Returns:
the result as a complex

sub

public Complex sub(Complex Z)
Substract a complex
Parameters:
Z - the complex to sub
Returns:
the result as a complex

mul

public Complex mul(Complex Z)
Multiply by a complex
Parameters:
Z - the colmplex to multiply

mul

public Complex mul(double d)
Multiply by a double

inverse

public static Complex inverse(Complex C)
inverse the complex

div

public Complex div(Complex Z)
divide by a complex
Parameters:
Z - the complex to be dived
Returns:
the result

div

public Complex div(double d)
divide by a double

toString

public java.lang.String toString()
get a string representation
Overrides:
toString in class java.lang.Object

pow

public Complex pow(int i)
            throws java.lang.IllegalArgumentException
pow the complex
Parameters:
i - the power

jfract V1.0a

Generee le 27.09.2002 08:21:59 PM