From 857973a51e284e0396922929fa97e0f7fbfe72a3 Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 4 Oct 2013 17:18:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=D0=BD=D0=B0=D0=B4=D0=BB=D0=B5=D0=B6=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D1=82=D0=BE=D1=87=D0=BA=D0=B8=20=D0=BA=20=D0=BE?= =?UTF-8?q?=D0=BA=D1=80=D1=83=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tse/lr2/Circle.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/tse/lr2/Circle.java b/src/tse/lr2/Circle.java index 3b384b8..75b7bfe 100644 --- a/src/tse/lr2/Circle.java +++ b/src/tse/lr2/Circle.java @@ -1,13 +1,21 @@ package tse.lr2; +import java.awt.Point; + /** * * @author aNNiMON */ public class Circle extends Ellipse { - public boolean isConsist() { - return false; + public boolean isConsist(Point point) { + Point center = getCenterPoint(); + int radius = center.x - points[0].x; + + double tmp = Math.pow(point.x - center.x, 2); + tmp += Math.pow(point.y - center.y, 2); + + return (tmp <= (radius * radius)); } @Override