|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--blue.shapes.Triangle
A 'triangle' is modeled in terms of its three sides, sideA, sideB, and sideC.
Constructor Summary | |
Triangle(double d)
Create an equilateral triangle. |
|
Triangle(double same,
double diff)
Create an isosceles triangle. |
|
Triangle(double a,
double b,
double c)
Create an irregular triangle. |
Method Summary | |
double |
area()
Returns the area of this triangle. |
void |
describe()
Describes this triangle in terms of its properties. |
void |
describe(OutStream os)
Describes this triangle in terms of its properties, writing the description to a OutStream. |
void |
describe(java.io.PrintStream ps)
Describes this triangle in terms of its properties, writing the description to a PrintStream. |
double |
perimeter()
Returns the perimeter of this triangle. |
double |
sideA()
Returns the sideA of the triangle. |
double |
sideB()
Returns the sideB of the triangle. |
double |
sideC()
Returns the sideC of the triangle. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Triangle(double d)
d
- the length of each side.public Triangle(double same, double diff)
same
- the length of two of the sides.diff
- the length of the "odd" side.public Triangle(double a, double b, double c)
a
- the length of sideA.b
- the length of sideB.c
- the length of sideC.Method Detail |
public double sideA()
public double sideB()
public double sideC()
public double area()
public double perimeter()
public void describe()
public void describe(java.io.PrintStream ps)
ps
- the PrintStream on which the description is written.public void describe(OutStream os)
os
- the PrintStream on which the description is written.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |