From 7e38b7adaea21a1629f6feeafa93ac501a76a9d5 Mon Sep 17 00:00:00 2001 From: Victor Date: Tue, 8 Oct 2013 10:38:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D1=91=D0=BD=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D1=80=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0=20Circle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tse/lr2/Circle.java | 8 +++++--- src/tse/lr2/LR_2_Tasks.java | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tse/lr2/Circle.java b/src/tse/lr2/Circle.java index 50dcae8..9238eed 100644 --- a/src/tse/lr2/Circle.java +++ b/src/tse/lr2/Circle.java @@ -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) { diff --git a/src/tse/lr2/LR_2_Tasks.java b/src/tse/lr2/LR_2_Tasks.java index 3ea85a9..ed6c91e 100644 --- a/src/tse/lr2/LR_2_Tasks.java +++ b/src/tse/lr2/LR_2_Tasks.java @@ -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); }