Class JSci.maths.Complex
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.maths.Complex

java.lang.Object
   |
   +----java.lang.Number
           |
           +----JSci.maths.Complex

public final class Complex
extends Number
The Complex class provides an object for encapsulating complex numbers.

Variable Index

 o I
The complex number 0+1i.
 o MINUS_I
The complex number 0-1i.
 o MINUS_ONE
The complex number -1+0i.
 o ONE
The complex number 1+0i.
 o ZERO
The complex number 0+0i.

Constructor Index

 o Complex(double, double)
Constructs the complex number x+yi.

Method Index

 o arg()
Returns the argument of this complex number.
 o byteValue()
Maps the complex number to a real number using the scalar product.
 o clone()
Creates a clone of this complex number.
 o doubleValue()
Maps the complex number to a real number using the scalar product.
 o equals(Object)
Compares two complex numbers for equality.
 o floatValue()
Maps the complex number to a real number using the scalar product.
 o hashCode()
Returns a hashcode for this complex number.
 o imag()
Returns the imaginary part of this complex number.
 o intValue()
Maps the complex number to a real number using the scalar product.
 o isInfinite()
Returns true if either the real or imaginary part is infinite.
 o isNaN()
Returns true if either the real or imaginary part is NaN.
 o longValue()
Maps the complex number to a real number using the scalar product.
 o mod()
Returns the modulus of this complex number.
 o polar(double, double)
Creates a complex number with the given modulus and argument.
 o real()
Returns the real part of this complex number.
 o shortValue()
Maps the complex number to a real number using the scalar product.
 o toString()
Returns a string representing the value of this complex number.

Variables

 o I
  public final static Complex I
The complex number 0+1i.
 o ONE
  public final static Complex ONE
The complex number 1+0i.
 o ZERO
  public final static Complex ZERO
The complex number 0+0i.
 o MINUS_ONE
  public final static Complex MINUS_ONE
The complex number -1+0i.
 o MINUS_I
  public final static Complex MINUS_I
The complex number 0-1i.

Constructors

 o Complex
  public Complex(double x,
                 double y)
Constructs the complex number x+yi.
Parameters:
x - the real value of a complex number
y - the imaginary value of a complex number

Methods

 o polar
  public static Complex polar(double mod,
                              double arg)
Creates a complex number with the given modulus and argument.
Parameters:
mod - the modulus of a complex number
arg - the argument of a complex number
 o equals
  public boolean equals(Object z)
Compares two complex numbers for equality.
Parameters:
z - a complex number
Overrides:
equals in class Object
 o clone
  public Object clone()
Creates a clone of this complex number.
Returns:
a copy of this complex number.
Overrides:
clone in class Object
 o toString
  public String toString()
Returns a string representing the value of this complex number.
Overrides:
toString in class Object
 o hashCode
  public int hashCode()
Returns a hashcode for this complex number.
Overrides:
hashCode in class Object
 o byteValue
  public byte byteValue()
Maps the complex number to a real number using the scalar product.
 o shortValue
  public short shortValue()
Maps the complex number to a real number using the scalar product.
 o intValue
  public int intValue()
Maps the complex number to a real number using the scalar product.
Overrides:
intValue in class Number
 o longValue
  public long longValue()
Maps the complex number to a real number using the scalar product.
Overrides:
longValue in class Number
 o floatValue
  public float floatValue()
Maps the complex number to a real number using the scalar product.
Overrides:
floatValue in class Number
 o doubleValue
  public double doubleValue()
Maps the complex number to a real number using the scalar product.
Overrides:
doubleValue in class Number
 o isNaN
  public boolean isNaN()
Returns true if either the real or imaginary part is NaN.
 o isInfinite
  public boolean isInfinite()
Returns true if either the real or imaginary part is infinite.
 o real
  public double real()
Returns the real part of this complex number.
 o imag
  public double imag()
Returns the imaginary part of this complex number.
 o mod
  public double mod()
Returns the modulus of this complex number.
 o arg
  public double arg()
Returns the argument of this complex number.

All Packages  Class Hierarchy  This Package  Previous  Next  Index