-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircle.java
More file actions
43 lines (35 loc) · 726 Bytes
/
Copy pathCircle.java
File metadata and controls
43 lines (35 loc) · 726 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import javafx.geometry.Point2D;
public class Circle
{
private Point2D center;
private double radius;
public Circle(double x, double y, double r)
{
setCenter(x,y);
setRadius(r);
}
public void setCenter(double x, double y)
{
center = new Point2D(x,y);
}
public void setRadius(double r)
{
radius = r;
}
public double getX()
{
return center.getX();
}
public double getY()
{
return center.getY();
}
public double getRadius()
{
return radius;
}
public boolean containsPoint(double x, double y)
{
return (center.distance(x,y) < radius);
}
}