Class VisualNumerics.math.Complex
All Packages Class Hierarchy This Package Previous Next Index
Class VisualNumerics.math.Complex
java.lang.Object
|
+----VisualNumerics.math.Complex
- public class Complex
- extends Object
This class implements complex numbers. It provides the basic operations
(addition, subtraction, multiplication, division) as well as a set of
complex functions.
-
im
- Imaginary part of the Complex.
-
INFINITY
- Complex infinity.
-
re
- Real part of the Complex.
-
suffix
- String used in converting Complex to String.
-
Complex()
- Construct a Complex equal to zero.
-
Complex(Complex)
-
Construct a Complex equal to the argument.
-
Complex(double)
-
Construct a Complex with a zero imaginary part.
-
Complex(double, double)
-
Construct a Complex with real and imaginary parts given by the input arguments.
-
abs(Complex)
-
Returns the absolute value (modulus) of a Complex, |z|.
-
acos(Complex)
-
Returns the inverse cosine (arc cosine) of a Complex.
-
add(Complex)
-
Adds a Complex and returns the sum, this += y.
-
add(Complex, Complex)
-
Returns the sum of two Complex's, x+y.
-
add(Complex, double)
-
Returns the sum of a Complex and a double, x+y.
-
add(double)
-
Adds a double and returns the sum, this += y.
-
add(double, Complex)
-
Returns the sum of a double and a Complex, x+y.
-
argument(Complex)
-
Returns the argument (phase) of a Complex, in radians.
-
asin(Complex)
-
-
conjugate(Complex)
-
Returns the complex conjugate of a Complex.
-
cos(Complex)
-
Returns the cosine of a Complex.
-
divide(Complex)
-
Divides by a Complex and returns the result, this /= y.
-
divide(Complex, Complex)
-
Returns Complex x divided by Complex y, x/y.
-
divide(Complex, double)
-
Returns a Complex divided by a double, x/y.
-
divide(double)
-
Divides by a double and returns the result, this /= y.
-
equals(Complex)
-
Compares this Complex with another.
-
equals(Object)
- Compares this object against the specified object.
-
exp(Complex)
-
Returns the exponential of a Complex z, exp(z).
-
isInfinite(Complex)
-
Returns true if either component is an infinite value.
-
isNaN(Complex)
-
Returns true if either component is a Not-a-Number (NaN) value.
-
log(Complex)
-
Returns the logarithm of a Complex z, log(z).
-
multiply(Complex)
-
Multiplies by a Complex and returns the product, this *= y.
-
multiply(Complex, Complex)
-
Returns the product of two Complexs, x*y.
-
multiply(Complex, double)
-
Returns the product of a Complex and a double, x*y.
-
multiply(double)
-
Multiplies by a double and returns the product, this *= y.
-
multiply(double, Complex)
-
Returns the product of a double and a Complex, x*y.
-
negate(Complex)
-
Returns the negative of a Complex, -z.
-
pow(Complex, Complex)
-
Returns the Complex x raised to the Complex y power.
-
pow(Complex, double)
-
Returns the Complex z raised to the x power.
-
sin(Complex)
-
Returns the sine of a Complex.
-
sqrt(Complex)
-
Returns the square root of a Complex.
-
subtract(Complex)
-
Subtracts a Complex and returns the difference, this -= y.
-
subtract(Complex, Complex)
-
Returns the difference of two Complexes, x-y.
-
subtract(Complex, double)
-
Returns the difference of a Complex and a double, x-y.
-
subtract(double)
-
Subtracts a double and returns the difference, this -= y.
-
subtract(double, Complex)
-
Returns the difference of a double and a Complex, x-y.
-
tan(Complex)
-
-
toString()
-
Returns a String representation for the specified Complex.
INFINITY
public final static Complex INFINITY
- Complex infinity.
re
public double re
- Real part of the Complex.
im
public double im
- Imaginary part of the Complex.
suffix
public static String suffix
- String used in converting Complex to String.
Default is "i", but sometimes "j" is desired.
Note that this is set for the class, not for
a particular instance of a Complex.
Complex
public Complex(Complex z)
- Construct a Complex equal to the argument.
- Parameters:
- z - A Complex object.
Complex
public Complex(double re,
double im)
- Construct a Complex with real and imaginary parts given by the input arguments.
- Parameters:
- re - A double value equal to the real part of the Complex object.
- im - A double value equal to the imaginary part of the Complex object.
Complex
public Complex(double re)
- Construct a Complex with a zero imaginary part.
- Parameters:
- re - A double value equal to the real part of the Complex object.
Complex
public Complex()
- Construct a Complex equal to zero.
toString
public String toString()
- Returns a String representation for the specified Complex.
- Returns:
- A String representation for this object.
- Overrides:
- toString in class Object
isNaN
public static boolean isNaN(Complex z)
- Returns true if either component is a Not-a-Number (NaN) value.
- Parameters:
- z - A Complex object.
- Returns:
- True if either component of the Complex object is NaN; false, otherwise.
isInfinite
public static boolean isInfinite(Complex z)
- Returns true if either component is an infinite value.
- Parameters:
- z - A Complex object.
- Returns:
- True if either component of the Complex object is NaN; false, otherwise.
equals
public boolean equals(Complex z)
- Compares this Complex with another.
- Parameters:
- z - A Complex object.
- Returns:
- True if the real and imaginary parts of this object are equal to their counterparts in the argument; false, otherwise.
equals
public boolean equals(Object obj)
- Compares this object against the specified object.
Note: To be useful in hashtables this method
considers two NaN double values to be equal. This
is not according to IEEE specification
- Parameters:
- obj - the object to compare with
- Returns:
- True if the objects are the same; false otherwise.
- Overrides:
- equals in class Object
negate
public static Complex negate(Complex z)
- Returns the negative of a Complex, -z.
- Parameters:
- z - A Complex object.
- Returns:
- A Complex object equal to the negative of the argument.
conjugate
public static Complex conjugate(Complex z)
- Returns the complex conjugate of a Complex.
- Parameters:
- z - A Complex object.
- Returns:
- The complex conjugate of the argument.
add
public static Complex add(Complex x,
Complex y)
- Returns the sum of two Complex's, x+y.
- Parameters:
- x - A Complex object.
- y - A Complex object.
- Returns:
- The sum of the arguments.
add
public static Complex add(double x,
Complex y)
- Returns the sum of a double and a Complex, x+y.
- Parameters:
- x - A double value.
- y - A Complex object.
- Returns:
- A Complex object equal to the sum of the arguments.
add
public static Complex add(Complex x,
double y)
- Returns the sum of a Complex and a double, x+y.
- Parameters:
- x - A Complex object.
- y - A double value.
- Returns:
- A Complex object equal to the sum of the arguments.
add
public Complex add(Complex y)
- Adds a Complex and returns the sum, this += y.
- Parameters:
- y - A Complex object.
- Returns:
- This object augmented by the argument.
add
public Complex add(double y)
- Adds a double and returns the sum, this += y.
- Parameters:
- y - A double value.
- Returns:
- This object augmented by the argument.
subtract
public static Complex subtract(Complex x,
Complex y)
- Returns the difference of two Complexes, x-y.
- Parameters:
- x - A Complex object.
- y - A Complex object.
- Returns:
- The difference between the input arguments.
subtract
public static Complex subtract(double x,
Complex y)
- Returns the difference of a double and a Complex, x-y.
- Parameters:
- x - A double value.
- y - A Complex object.
- Returns:
- The difference between the input arguments.
subtract
public static Complex subtract(Complex x,
double y)
- Returns the difference of a Complex and a double, x-y.
- Parameters:
- x - A Complex object.
- y - A double value.
- Returns:
- A Complex object equal to the difference between the arguments.
subtract
public Complex subtract(Complex y)
- Subtracts a Complex and returns the difference, this -= y.
- Parameters:
- y - A Complex object.
- Returns:
- This object less the input argument.
subtract
public Complex subtract(double y)
- Subtracts a double and returns the difference, this -= y.
- Parameters:
- y - A double value.
- Returns:
- This object less the input argument.
multiply
public static Complex multiply(double x,
Complex y)
- Returns the product of a double and a Complex, x*y.
- Parameters:
- x - A double value.
- y - A Complex object.
- Returns:
- The product of the arguments.
multiply
public static Complex multiply(Complex x,
double y)
- Returns the product of a Complex and a double, x*y.
- Parameters:
- x - A Complex object.
- y - A double value.
- Returns:
- The product of the arguments.
multiply
public Complex multiply(double y)
- Multiplies by a double and returns the product, this *= y.
- Parameters:
- y - A double value.
- Returns:
- This object multiplied by the input argument.
multiply
public static Complex multiply(Complex x,
Complex y)
- Returns the product of two Complexs, x*y.
- Parameters:
- x - A Complex object.
- y - A Complex object.
- Returns:
- The product of the input arguments.
multiply
public Complex multiply(Complex y)
- Multiplies by a Complex and returns the product, this *= y.
- Parameters:
- y - A Complex object.
- Returns:
- This object multiplied by the input argument.
divide
public static Complex divide(Complex x,
double y)
- Returns a Complex divided by a double, x/y.
- Parameters:
- x - A Complex object.
- y - A double value.
- Returns:
- The quotient of the input arguments.
divide
public Complex divide(double y)
- Divides by a double and returns the result, this /= y.
- Parameters:
- y - A double value.
- Returns:
- This object divided by the input argument.
divide
public static Complex divide(Complex x,
Complex y)
- Returns Complex x divided by Complex y, x/y.
- Parameters:
- x - A Complex object.
- y - A Complex object.
- Returns:
- The quotient of the input arguments.
divide
public Complex divide(Complex y)
- Divides by a Complex and returns the result, this /= y.
- Parameters:
- y - A Complex object.
- Returns:
- This object divided by the input argument.
abs
public static double abs(Complex z)
- Returns the absolute value (modulus) of a Complex, |z|.
- Parameters:
- z - A Complex object.
- Returns:
- A double value equal to the absolute value of the argument.
argument
public static double argument(Complex z)
- Returns the argument (phase) of a Complex, in radians.
- Parameters:
- z - A Complex object.
- Returns:
- A double value equal to the argument or phase of a Complex.
sqrt
public static Complex sqrt(Complex z)
- Returns the square root of a Complex.
- Parameters:
- z - A Complex object.
- Returns:
- The square root of the input argument.
exp
public static Complex exp(Complex z)
- Returns the exponential of a Complex z, exp(z).
- Parameters:
- z - A Complex object.
- Returns:
- The exponential of the argument.
log
public static Complex log(Complex z)
- Returns the logarithm of a Complex z, log(z).
- Parameters:
- z - A Complex object.
- Returns:
- The logarithm of the argument.
sin
public static Complex sin(Complex z)
- Returns the sine of a Complex.
- Parameters:
- z - A Complex object.
- Returns:
- The sine of the argument.
cos
public static Complex cos(Complex z)
- Returns the cosine of a Complex.
- Parameters:
- z - A Complex object.
- Returns:
- The cosine of the argument.
tan
public static Complex tan(Complex z)
asin
public static Complex asin(Complex zinp)
acos
public static Complex acos(Complex z)
- Returns the inverse cosine (arc cosine) of a Complex.
- Parameters:
- z - A Complex object.
- Returns:
- The inverse cosine of the argument.
pow
public static Complex pow(Complex z,
double x)
- Returns the Complex z raised to the x power.
- Parameters:
- z - A Complex object.
- x - A double value.
- Returns:
- A Complex object equal to zx.
pow
public static Complex pow(Complex x,
Complex y)
- Returns the Complex x raised to the Complex y power.
- Parameters:
- x - A Complex object.
- y - A Complex object.
- Returns:
- A Complex object equal to xy.
All Packages Class Hierarchy This Package Previous Next Index