|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.ObjectPiFraction
class PiFraction
This class introduces fractions of π. The only actual difference between a Fraction and a PiFraction is their output formatting. Also,
PiFraction is only used for outputting.
| Field Summary | |
|---|---|
(package private) long |
d
denominator |
(package private) long |
n
numerator |
| Constructor Summary | |
|---|---|
PiFraction(long nn)
Constructs a fraction from an integer. |
|
PiFraction(long nn,
long dd)
Constructs a fraction from its numerator and denominator. |
|
| Method Summary | |
|---|---|
(package private) boolean |
isEqual(PiFraction c)
Checks if this PiFraction is equal to another PiFraction. |
(package private) long |
toDegrees()
Converts the angle from rads to degrees. |
(package private) String |
toTeX()
Prints this PiFraction formatted as TeX code. |
(package private) String |
toText()
Prints this PiFraction formatted as text. |
| Methods inherited from class |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
long d
long n
| Constructor Detail |
|---|
PiFraction(long nn)
nn - the integer (constructs fraction nn/1)
PiFraction(long nn,
long dd)
nn - nominatordd - denominator
IllegalArgumentException - Throws an exception if the denominator would be zero.| Method Detail |
|---|
boolean isEqual(PiFraction c)
PiFraction is equal to another PiFraction.
c - comparand
PiFraction is equal to the comparand, false otherwiselong toDegrees()
PiFractionString toTeX()
-\frac{3\pi}{2}String toText()
-3*pi/2
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||