Изменён конструктор класса Circle

This commit is contained in:
Victor 2013-10-08 10:38:58 +03:00
parent 8162f435b9
commit 7e38b7adae
2 changed files with 7 additions and 5 deletions

View File

@ -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) {

View File

@ -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);
}