|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--blue.shapes.Polygon
A 'regular polygon' is modeled in terms of its degree (number of sides) and its side length.
Constructor Summary | |
Polygon(int d,
double s)
Create a polygon. |
Method Summary | |
double |
area()
Return the area of this polygon. |
Circle |
circumscribingCircle()
Return the circumscribing circle of this polygon. |
void |
dec()
Transform this polygon to a polygon of one less degree. |
void |
decSide()
Subtract one from the length of the sides of this polygon. |
int |
degree()
Returns the degree of this polygon. |
void |
describe()
Write a description of this perimeter to the standard output file. |
void |
describe(OutStream os)
Write a description of this polygon to the given OutStream. |
void |
describe(java.io.PrintStream ps)
Write a description of this polygon to the given PrintStream. |
void |
inc()
Transform this polygon to a polygon of one additional degree. |
void |
incSide()
Add one to the length of the sides of this polygon. |
Circle |
inscribingCircle()
Return the inscribing circle of this polygon. |
double |
perimeter()
Return the perimeter of this polygon. |
void |
resize(int s)
Resize this polygon by changing the lengths of each side. |
double |
side()
Returns the side length of this polygon. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Polygon(int d, double s)
d
- the degree of the polygon.s
- side length of the polygon.Method Detail |
public int degree()
public double side()
public void inc()
public void dec()
public void resize(int s)
s
- the new side length of this polygon.public void incSide()
public void decSide()
public double area()
public double perimeter()
public void describe()
public void describe(java.io.PrintStream ps)
ps
- the stream to which the description is writtenpublic void describe(OutStream os)
os
- the stream to which the description is writtenpublic Circle circumscribingCircle()
public Circle inscribingCircle()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |