|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--blue.shapes.Circle
A 'circle' is modeled in terms of its radius, a real number.
Constructor Summary | |
Circle(double r)
Create a circle. |
Method Summary | |
double |
area()
Returns the area of this circle. |
Polygon |
circumscribingPolygon(int d)
Return the regular polygon of degree equal to the given int which has the property that the midpoints of its sides each touch this circle. |
Square |
circumscribingSquare()
Return the square which has the property that the midpoints of its sides each touch this circle. |
void |
describe()
Write a description of this circle to the standard output file. |
void |
describe(OutStream os)
Write a description of this circle to the given OutStream. |
void |
describe(java.io.PrintStream ps)
Write a description of this circle to the given PrintStream. |
double |
diameter()
Returns the diameter of this circle. |
void |
expand(double a)
Expand this circle by augmenting its radius by the given number. |
Polygon |
inscribingPolygon(int d)
Return the regular polygon of degree equal to the given int which has the property that its corners touch this circle. |
Square |
inscribingSquare()
Return the square which has the property that its corners touch the circle. |
double |
perimeter()
Returns the circumference of this circle. |
double |
radius()
Returns the radius of this circle. |
void |
resize(double s)
Set the radius of the circle to the given number |
void |
shrink(double a)
Shrink this circle by diminishing its radius by the given number. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Circle(double r)
r
- the radius of the circleMethod Detail |
public double radius()
public double diameter()
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 void expand(double a)
a
- amount by which the circle is expandedpublic void shrink(double a)
a
- amount by which the circle is contractedpublic void resize(double s)
a
- size, in terms of radius, to which the circle is setpublic Square circumscribingSquare()
public Square inscribingSquare()
public Polygon circumscribingPolygon(int d)
d
- number of sides of the new polygonpublic Polygon inscribingPolygon(int d)
d
- number of sides of the new polygon
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |