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

C

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)

D

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.

E

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

G

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

M

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)

P

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.

T

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