|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensourcephysics.sip.ch02.Complex
public class Complex
Complex defines a new data type that models a complex number.
| Constructor Summary | |
|---|---|
Complex()
Constructs a complex number. |
|
Complex(double real,
double imag)
Constructs a complex number with given real and imaginary parts. |
|
| Method Summary | |
|---|---|
Complex |
add(Complex c)
Adds a complex number to this complex number and returns the new complex number. |
void |
conjugate()
Conjugates this complex number. |
Complex |
multiply(Complex c)
Multiples this complex number by another complex number and returns the new complex number. |
java.lang.String |
toString()
Represents this complex number as a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Complex()
public Complex(double real,
double imag)
real - doubleimag - double| Method Detail |
|---|
public void conjugate()
public Complex add(Complex c)
c - Complex
public Complex multiply(Complex c)
c - Complex
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||