public class Circle
extends java.lang.Object
| Constructor and Description |
|---|
Circle(double radius)
Constructor for a circle with the center at the origin
|
Circle(TwoDimensionalVector center,
double radius)
Constructor for a circle
|
| Modifier and Type | Method and Description |
|---|---|
double |
getArea()
Gets the area of the circle
|
TwoDimensionalVector |
getCenter()
Gets the center of the circle
|
double |
getCircumference()
Gets the circumference of the circle
|
double |
getDiameter()
Gets the diameter of the circle
|
double |
getRadius()
Gets the radius of the circle
|
boolean |
isPointInCircle(TwoDimensionalVector point)
Checks if the specified point is inside the circle
|
boolean |
isPointOnCircumference(TwoDimensionalVector point)
Checks if the specified point is on the circumference of the circle
|
Circle |
setCenter(TwoDimensionalVector newCenter)
Sets the center of the circle
|
Circle |
setRadius(double newRadius)
Sets the radius of the circle
|
public Circle(TwoDimensionalVector center, double radius) throws IncompatibleDimensionsException
center - The center of the circleradius - The radius for the circleIncompatibleDimensionsExceptionpublic Circle(double radius)
throws IncompatibleDimensionsException
radius - The radius for the circleIncompatibleDimensionsExceptionpublic TwoDimensionalVector getCenter()
public double getRadius()
public Circle setCenter(TwoDimensionalVector newCenter)
newCenter - The new centerpublic Circle setRadius(double newRadius) throws IncompatibleDimensionsException
newRadius - The new radiusIncompatibleDimensionsExceptionpublic double getDiameter()
public double getCircumference()
public double getArea()
public boolean isPointOnCircumference(TwoDimensionalVector point)
point - The pointpublic boolean isPointInCircle(TwoDimensionalVector point)
point - The point