All Packages Class Hierarchy
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
_
Index of all Fields and Methods
- _imaginary.
Variable in class cmpsci197c.Complex
-
- _real.
Variable in class cmpsci197c.Complex
-
- clone().
Method in class cmpsci197c.Complex
- Clone procedure
- Complex().
Constructor for class cmpsci197c.Complex
- Default constructor creates the complex number z = (0,0)
- Complex(double, double).
Constructor for class cmpsci197c.Complex
- Creates the complex number z = (real, imaginary)
- conjugate().
Method in class cmpsci197c.Complex
- For any complex number z = (a,b) the conjugate
(usually denoted z-bar) is defined as (a,-b)
- divide(Complex).
Method in class cmpsci197c.Complex
- Dividing two complex numbers z = (a,b) w = (c,d) is defined as
z * w-bar / |w|^2
The |w|^2 is equivalent to w * w.conjugate() where
the conjugate of w = (c,d) is defined as (c,-d)
Note that multiplying by the conjugate produces a non-negative real
number so that we can easily divide the real and imaginary
components of the imaginary numbers.
- equals(Complex).
Method in class cmpsci197c.Complex
- Two complex numbers are equal if and only if both their
real and imaginary components are equal
- equals(Object).
Method in class cmpsci197c.Complex
- Two complex numbers are equal if both their
real and imaginary components are equal
- getImaginary().
Method in class cmpsci197c.Complex
- Returns the imaginary component of the complex number
- getReal().
Method in class cmpsci197c.Complex
- Returns the real component of the complex number
- main(String[]).
Static method in class cmpsci197c.Complex
- Tests the Complex API
- minus(Complex).
Method in class cmpsci197c.Complex
- Subtracting two complex numbers (a,b) (c,d) is defined as
(a - c, b -d)
- plus(Complex).
Method in class cmpsci197c.Complex
- Adding two complex numbers (a,b) (c,d) is defined as
(a+c,b+d)
- power(int).
Method in class cmpsci197c.Complex
- Return the exponant of the complex number.
- times(Complex).
Method in class cmpsci197c.Complex
- Multiplying two complex numbers (a,b) (c,d) is defined as
(a*c - b*d, a*d + b*c)
- toString().
Method in class cmpsci197c.Complex
- Returns
(r,i)
where r is the real
component and i is the imaginary component