|
Treeviz 0.37 2010-10-17 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.util.Complex
public class Complex
Immutable complex number of the form x+bi.
| Constructor Summary | |
|---|---|
Complex(double x,
double y)
Creates a complex number with the real part x and the imaginary part y. |
|
| Method Summary | |
|---|---|
Complex |
add(Complex that)
Returns a complex number whose value is (this + that). |
static Complex |
add(Complex a,
Complex b)
Returns a complex number whose value is (a + b). |
double |
arg()
Returns the argument of this complex number (the angle in radians with the x-axis in polar coordinates). |
Complex |
clone()
Returns a clone of this complex number. |
Complex |
div(Complex that)
Returns a complex number whose value is (this / that). |
static Complex |
div(Complex a,
Complex b)
Returns a complex number whose value is (a / b). |
boolean |
equals(java.lang.Object o)
Returns true of this complex number is equal to the specified complex number. |
int |
hashCode()
Returns a hash code for this complex number. |
double |
img()
Returns the imaginary part of the complex number. |
boolean |
isNaN()
Returns true if this complex numer is not a number (NaN). |
static void |
main(java.lang.String[] args)
|
double |
mod()
Returns the modulo of this complex number. |
Complex |
mul(Complex that)
Returns a complex number whose value is (this * that). |
static Complex |
mul(Complex a,
Complex b)
Returns a complex number whose value is (a * b). |
double |
real()
Returns the real part of the complex number. |
Complex |
sqrt()
Returns the principal branch of the square root of this complex number. |
Complex |
sub(Complex that)
Returns a complex number whose value is (this - that). |
static Complex |
sub(Complex a,
Complex b)
Returns a complex number whose value is (a - b). |
java.lang.String |
toString()
Returns a descriptive string representation of this complex number. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Complex(double x,
double y)
x - real part of the complex numbery - imaginary part of the complex number| Method Detail |
|---|
public double real()
public double img()
public Complex add(Complex that)
that - A complex number.
public static Complex add(Complex a,
Complex b)
a - A complex number.b - A complex number.
public Complex sub(Complex that)
that - A complex number.
public static Complex sub(Complex a,
Complex b)
a - A complex number.b - A complex number.
public Complex mul(Complex that)
that - A complex number.
public static Complex mul(Complex a,
Complex b)
a - A complex number.b - A complex number.
public Complex div(Complex that)
that - A complex number.
public static Complex div(Complex a,
Complex b)
a - A complex number.b - A complex number.
public double arg()
public double mod()
public Complex sqrt()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic Complex clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isNaN()
public static void main(java.lang.String[] args)
|
Copyright 2007-2008 (c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||