From a04ea1b2720980446120d1e8ccb1ce22642bd7ee Mon Sep 17 00:00:00 2001 From: Victor Date: Fri, 4 Oct 2013 17:10:16 +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=D1=8B=20=D1=81=D1=82=D0=B0=D1=82=D0=B8=D1=87=D0=B5=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=D0=B5=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4=D1=8B=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81=D0=B0=20Ell?= =?UTF-8?q?ipse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tse/lr2/Ellipse.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tse/lr2/Ellipse.java b/src/tse/lr2/Ellipse.java index 5a961aa..61635c3 100644 --- a/src/tse/lr2/Ellipse.java +++ b/src/tse/lr2/Ellipse.java @@ -27,6 +27,10 @@ public class Ellipse { points = Arrays.copyOf(ellipse.points, POINTS); } + public static Point getCenterPoint(Ellipse ellipse) { + return ellipse.getCenterPoint(); + } + public Point getCenterPoint() { int cx = (points[1].x - points[0].x) / 2 + points[0].x; int cy = (points[2].y - points[0].y) / 2 + points[0].y; @@ -34,6 +38,10 @@ public class Ellipse { return center; } + public static double getSquare(Ellipse ellipse) { + return ellipse.getSquare(); + } + public double getSquare() { Point center = getCenterPoint(); double hor = center.x - points[0].x; @@ -41,6 +49,10 @@ public class Ellipse { return Math.PI * hor * ver; } + public static double getDistanceOfCentres(Ellipse ellipse1, Ellipse ellipse2) { + return ellipse1.getDistanceOfCentres(ellipse2); + } + public double getDistanceOfCentres(Ellipse ellipse) { return (getCenterPoint().distance(ellipse.getCenterPoint())); }