|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectComplex
public class Complex
Immutable, complex numbers. A Complex consists of a real and imaginary part, called Cartesian coordinates. The Complex class provides methods for arithmetic such as: add, subtract, multiply, divide, negate and invert. Also provided are complex functions sin, cos, tan, asin, acos, atan, sqrt, log, exp, pow, sinh, cosh, tanh, atanh. Source code Complex.java
Constructor Summary | |
---|---|
Complex()
cartesian coordinates real and imaginary are NaN |
|
Complex(Complex z)
construct a copy of a Complex object |
|
Complex(double x)
real value, imaginary=0.0 |
|
Complex(double x,
double y)
cartesian coordinates real and imaginary |
Method Summary | |
---|---|
double |
abs()
compute the absolute value of a complex number |
Complex |
acos()
compute the arccosine of a complex number |
Complex |
add(Complex z)
add complex numbers |
Complex |
add(double d)
add a double to a complex number |
double |
argument()
extract the argument of the complex number |
Complex |
asin()
compute the arcsine of a complex number |
Complex |
atan()
compute the arctangent of a complex number |
Complex |
atanh()
compute the inverse hyperbolic tangent of a complex number |
Complex |
cartesian()
convert polar to cartesian |
Complex |
conjugate()
conjugate the complex number |
Complex |
cos()
compute the cosine of the complex number |
Complex |
cosh()
compute the hyperbolic cosine of the complex number |
Complex |
divide(Complex z)
divide the complex number by z |
Complex |
divide(double d)
divide the complex number by the double d |
boolean |
equals(Complex z)
compare complex numbers for equality |
Complex |
exp()
compute e to the power of the complex number |
double |
imaginary()
extract the imaginary part of the complex number |
Complex |
invert()
invert the complex number |
Complex |
log()
compute the natural logarithm of the complex number |
double |
magnitude()
extract the magnitude of the complex number |
Complex |
multiply(Complex z)
multiply complex numbers |
Complex |
multiply(double d)
multiply a complex number by a double |
Complex |
negate()
negate the complex number |
static Complex |
parseComplex(java.lang.String s)
convert text representation to a Complex. |
Complex |
polar()
convert cartesian to polar |
Complex |
pow(Complex z)
compute the complex number raised to the power z |
Complex |
pow(double d)
compute the complex number raised to the power double d |
double |
real()
extract the real part of the complex number |
Complex |
sin()
compute the sin of the complex number |
Complex |
sinh()
compute the hyperbolic sin of the complex number |
Complex |
sqrt()
compute the square root of the complex number |
Complex |
subtract(Complex z)
subtract z from the complex number |
Complex |
subtract(double d)
subtract the double d from the complex number |
Complex |
tan()
compute the tangent of the complex number |
Complex |
tanh()
compute the hyperbolic tangent of the complex number |
java.lang.String |
toString()
convert a complex number to a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Complex()
public Complex(Complex z)
public Complex(double x)
public Complex(double x, double y)
Method Detail |
---|
public Complex polar()
public Complex cartesian()
public double real()
public double imaginary()
public double magnitude()
public double argument()
public Complex add(Complex z)
public Complex add(double d)
public Complex subtract(Complex z)
public Complex subtract(double d)
public Complex negate()
public Complex multiply(Complex z)
public Complex multiply(double d)
public Complex divide(Complex z)
public Complex divide(double d)
public Complex invert()
public Complex conjugate()
public double abs()
public boolean equals(Complex z)
public java.lang.String toString()
toString
in class java.lang.Object
public static Complex parseComplex(java.lang.String s)
public Complex exp()
public Complex log()
public Complex sqrt()
public Complex pow(Complex z)
public Complex pow(double d)
public Complex sin()
public Complex cos()
public Complex tan()
public Complex asin()
public Complex acos()
public Complex atan()
public Complex sinh()
public Complex cosh()
public Complex tanh()
public Complex atanh()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |