|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfpp.fractal.Complex
public class Complex
The Complex class models a complex number. It provides the operations addition to a Complex, multiplication by a Complex factor, the square of a Complex and the square of the absolute value of a Complex.
Field Summary | |
---|---|
double |
im
The Complex's imaginary part. |
double |
re
The Complex's real part. |
Constructor Summary | |
---|---|
Complex(Complex c)
Constructs a new Complex from a given Complex. |
|
Complex(double re,
double im)
Constructs a new Complex from two doubles. |
Method Summary | |
---|---|
void |
addTo(Complex increment)
Increments this complex number. |
double |
getAbsSquare()
Calculates the square of this complex number's absolute value. |
void |
multiplyBy(Complex factor)
Multiplies this complex number by another. |
void |
square()
Squares this complex number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public double re
public double im
Constructor Detail |
---|
public Complex(double re, double im)
re
- the real part of the Complexim
- the imaginary part of the Complexpublic Complex(Complex c)
c
- the given ComplexMethod Detail |
---|
public void addTo(Complex increment)
increment
- the increment to add to thispublic void multiplyBy(Complex factor)
factor
- the factor to multiply this complex number bypublic void square()
public double getAbsSquare()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |