com.pearsoneduc.ip.util
Class Complex

java.lang.Object
  |
  +--com.pearsoneduc.ip.util.Complex

public class Complex
extends java.lang.Object

A simple complex number class.

Version:
1.1 [1999/08/02]
Author:
Nick Efford

Field Summary
 float im
          Imaginary part of number.
 float re
          Real part of number.
 
Constructor Summary
Complex()
           
Complex(float real, float imaginary)
           
 
Method Summary
 float getMagnitude()
           
 float getPhase()
           
 void setPolar(double r, double theta)
           
 void swapWith(Complex value)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

re

public float re
Real part of number.

im

public float im
Imaginary part of number.
Constructor Detail

Complex

public Complex()

Complex

public Complex(float real,
               float imaginary)
Method Detail

getMagnitude

public float getMagnitude()

getPhase

public float getPhase()

setPolar

public void setPolar(double r,
                     double theta)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

swapWith

public void swapWith(Complex value)