public class Circle extends Shape
DEFAULT_COLOR
Constructor and Description |
---|
Circle(double x,
double y,
double r)
Creates a circle of the given radius and default color
centered at the given coordinates.
|
Circle(Point cen,
double r)
Creates a circle of the given radius and default color
centered at the given point.
|
Circle(Point cen,
Point pt)
Creates a circle of the default color going through the
given center and point on the circumference.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Point point)
Determines if this circle contains the given point.
|
void |
draw(android.graphics.Canvas canvas)
Draws this circle on the given canvas.
|
Point |
getCenter()
Returns the center of this circle.
|
double |
getRadius()
Returns the radius of this circle.
|
void |
move(double dx,
double dy)
Moves this circle by the given displacement.
|
public Circle(double x, double y, double r)
x
- the x-coordinate of the circle centery
- the y-coordinate of the circle centerr
- the radius of the circlepublic Circle(Point cen, double r)
cen
- the center of the circler
- the radius of the circlepublic boolean contains(Point point)
public void draw(android.graphics.Canvas canvas)
public Point getCenter()
public double getRadius()