|
JML | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmlspecs.samples.dbc.ComplexOps org.jmlspecs.samples.dbc.Rectangular
Complex numbers in rectangular coordinates.
Class Specifications |
Specifications inherited from class Object |
represents objectState <- org.jmlspecs.lang.JMLDataGroup.IT; public represents _getClass <- \typeof(this); |
Specifications inherited from interface Complex |
axiom ( \forall double d, dd; dd > 0.0; d%dd > -dd&&d%dd < dd); axiom ( \forall double d, dd; ; d > -dd ==> d+dd > 0.0); |
Model Field Summary |
Model fields inherited from class java.lang.Object |
_getClass, objectState, theString |
Ghost Field Summary |
Ghost fields inherited from class java.lang.Object |
objectTimesFinalized, owner |
Ghost fields inherited from interface org.jmlspecs.samples.dbc.Complex |
tolerance |
Field Summary | |
private double |
img
The imaginary part of this number. |
private double |
re
The real part of this number. |
Constructor Summary | |
Rectangular()
Initialize this Complex number to be 0+(0*i). |
|
Rectangular(double re)
Initialize this Complex number to be re+(0*i). |
|
Rectangular(double re,
double img)
Initialize this Complex number to be re+(img*i). |
Model Method Summary |
Model methods inherited from class java.lang.Object |
hashValue |
Model methods inherited from interface org.jmlspecs.samples.dbc.Complex |
positiveRemainder, similarAngle |
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. |
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 re
private double img
Constructor Detail |
public Rectangular()
public Rectangular(double re)
public Rectangular(double re, double img)
Method Detail |
public 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 |