|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jmlspecs.samples.dbc.ComplexOps
org.jmlspecs.samples.dbc.Polar
Complex numbers in polar coordinates.
| Field Summary | |
private double |
ang
The angle of this number. |
private double |
mag
The magnitude of this number. |
| Constructor Summary | |
Polar(double mag,
double ang)
Initialize this polar coordinate number with magnitude mag and angle ang, except that when the magnitude is negative, this is interpreted as magnitude -mag and angle ang+StrictMath.PI. |
|
| Method Summary | |
double |
angle()
Return the angle of this complex number. |
double |
imaginaryPart()
Return the imaginary part of this complex number. |
double |
magnitude()
Return the magnitude of this complex number. |
double |
realPart()
Return the real part of this complex number. |
static double |
standardizeAngle(double rad)
Standardize the angle so it's between -StrictMath.PI and StrictMath.PI (radians). |
String |
toString()
|
| Methods inherited from class org.jmlspecs.samples.dbc.ComplexOps |
add, div, equals, hashCode, mul, sub |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
private double mag
private double ang
| Constructor Detail |
public Polar(double mag,
double ang)
mag - the magnitude desiredang - the angle in radians, measured
counterclockwise from the positive x axis| Method Detail |
public static double standardizeAngle(double rad)
throws IllegalArgumentException
IllegalArgumentExceptionpublic double realPart()
Complex
public double imaginaryPart()
Complex
public double magnitude()
Complex
public double angle()
Complex
public String toString()
toString in class Object
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||