|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCircle
public class Circle
A Circle representation class. Circle instances represent majorAxisRadius two dimensional circle in Euclidean space.
Constructor Summary | |
---|---|
Circle(double radius)
Constructs majorAxisRadius new Circle, sets the center coordinates to (0,0) and the radius the the give parameter. |
|
Circle(double x0,
double y0,
double radius)
Constructs majorAxisRadius new Circle, sets the center point to the given coordinates, and the radius the the give parameter. |
|
Circle(Point center,
double radius)
Constructs majorAxisRadius new Circle, sets the center point to the given point, and the radius the the give parameter. |
Method Summary | |
---|---|
Point |
getCenter()
Returns the center point of the circle. |
double |
getRadius()
Returns the radius of the circle. |
boolean |
isInside(Point candidate)
Checks if majorAxisRadius given point is inside the circle or not (being on the circle means it is not inside) |
void |
scale(double factor)
Scales the circle by the given factor. |
void |
translate(Point delta)
Translates the circle by the given delta point. |
Point |
valueAt(double alpha)
Calculate majorAxisRadius point on the circle given an angle parameter in degrees. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Circle(double radius) throws java.lang.IllegalArgumentException
radius
- The radius of the circle
java.lang.IllegalArgumentException
- When the radius is not positivepublic Circle(double x0, double y0, double radius) throws java.lang.IllegalArgumentException
x0
- The x coordinate of the center pointy0
- The y coordinate of the center pointradius
- The radius of the circle
java.lang.IllegalArgumentException
- When the radius is not positivepublic Circle(Point center, double radius) throws java.lang.IllegalArgumentException
center
- - the center pointradius
- The radius of the circle
java.lang.IllegalArgumentException
- When the radius is not positiveMethod Detail |
---|
public Point valueAt(double alpha)
alpha
- The angle in degrees
public double getRadius()
public Point getCenter()
public void scale(double factor) throws java.lang.IllegalArgumentException
factor
- The scaling factor
java.lang.IllegalArgumentException
- When factor is not positivepublic void translate(Point delta)
delta
- The translation point deltapublic boolean isInside(Point candidate)
candidate
- The point checked.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |