Изменён конструктор класса Circle
This commit is contained in:
parent
8162f435b9
commit
7e38b7adae
@ -12,9 +12,11 @@ public class Circle extends Ellipse {
|
||||
super();
|
||||
}
|
||||
|
||||
public Circle(Point p1, Point p2) {
|
||||
super(new Point(p1.x, p1.y), new Point(p2.x, p1.y),
|
||||
new Point(p1.x, p2.y), new Point(p2.x, p2.y));
|
||||
public Circle(Point center, int radius) {
|
||||
super(new Point(center.x - radius, center.y - radius),
|
||||
new Point(center.x + radius, center.y - radius),
|
||||
new Point(center.x - radius, center.y + radius),
|
||||
new Point(center.x + radius, center.y + radius));
|
||||
}
|
||||
|
||||
public boolean isConsist(Point point) {
|
||||
|
@ -93,8 +93,8 @@ public class LR_2_Tasks {
|
||||
);
|
||||
ellipse3 = new Ellipse(ellipse1);
|
||||
|
||||
circle1 = new Circle( new Point(1, 1), new Point(6, 6) );
|
||||
circle2 = new Circle( new Point(5, 4), new Point(15, 14) );
|
||||
circle1 = new Circle( new Point(3, 3), 6 );
|
||||
circle2 = new Circle( new Point(5, 4), 2 );
|
||||
|
||||
point1 = new Point(3, 3);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user