Class pmr.euclid.Complex
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.euclid.Complex

java.lang.Object
   |
   +----pmr.euclid.Status
           |
           +----pmr.euclid.Real2
                   |
                   +----pmr.euclid.Complex

public class Complex
extends Real2

Complex - complex number - derived from Real2

Complex represents a complex number. A reasonable number of arithmetic operations are included - DeMoivre's theorem is used for some of them so there may be quicker implementations elsewhere.

Author:
(C) P. Murray-Rust, 1996

Constructor Index

 o Complex()
 o Complex(Complex)
 o Complex(double)
real component only
 o Complex(double, Angle)
in polar coords
 o Complex(double, double)
from components
 o Complex(Polar)
 o Complex(Real2)
from base class

Method Index

 o divideBy(Complex)
divide a complex by a complex
 o getPolar()
 o getR()
get as polar coords
 o getReal()
gets real part
 o getTheta()
 o multiply(Complex)
multiply a complex by a complex
 o negative()
unary minus MODIFIES object
 o sqrt(Complex)
complex square root
 o toString()

Constructors

 o Complex
  public Complex()
 o Complex
  public Complex(double a)
real component only
 o Complex
  public Complex(double a,
                 double b)
from components
 o Complex
  public Complex(Real2 a)
from base class
 o Complex
  public Complex(double r,
                 Angle th)
in polar coords
 o Complex
  public Complex(Polar p)
 o Complex
  public Complex(Complex a)

Methods

 o getReal
  public double getReal()
gets real part
 o negative
  public void negative()
unary minus MODIFIES object
Overrides:
negative in class Real2
 o multiply
  public Complex multiply(Complex f)
multiply a complex by a complex
 o divideBy
  public Complex divideBy(Complex f) throws ArithmeticException
divide a complex by a complex
 o getR
  public double getR()
get as polar coords
 o getTheta
  public Angle getTheta()
 o getPolar
  public Polar getPolar()
 o sqrt
  public static Complex sqrt(Complex a)
complex square root
 o toString
  public String toString()
Overrides:
toString in class Real2

All Packages  Class Hierarchy  This Package  Previous  Next  Index