From 45d8c51946d30e2319126d2c6e49f14f1b87fdcd Mon Sep 17 00:00:00 2001 From: Slava Rogozhkin Date: Sun, 3 Nov 2024 14:36:20 +0300 Subject: [PATCH] =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=20=D0=BD?= =?UTF-8?q?=D0=B0=D0=B4=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=D0=BC=D0=B8?= =?UTF-8?q?,=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?UTF-8?q?=D0=BE=20=D0=BE=D1=84=D0=BE=D1=80=D0=BC=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __pycache__/more_class.cpython-312.pyc | Bin 5431 -> 5431 bytes more_class.py | 27 ++++++++++++------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/__pycache__/more_class.cpython-312.pyc b/__pycache__/more_class.cpython-312.pyc index 410bbfc4e56fa2f539dfe09873fe463dea71d878..47527372edf6233576cb57870e55f6f8eb46a1c2 100644 GIT binary patch delta 18 Ycmdn4wOxzzG%qg~0}wph$f+j^05Qr0o&W#< delta 18 Ycmdn4wOxzzG%qg~0}zOAV!Z diff --git a/more_class.py b/more_class.py index fa950a0..34fe7da 100644 --- a/more_class.py +++ b/more_class.py @@ -2,24 +2,23 @@ from math import sqrt from multipledispatch import dispatch class PointXY(): - def distance_from_zero(point): - return sqrt( point.x ** 2 + point.y ** 2 ) + def distance_from_zero(point): + return sqrt( point.x ** 2 + point.y ** 2 ) - def distance_to(self, point): - return sqrt( (point.x - self.x) ** 2 + (point.y - self.y) ** 2) + def distance_to(self, point): + return sqrt( (point.x - self.x) ** 2 + (point.y - self.y) ** 2) - def if_inside(self, r): - if (r.a.x <= self.x <= r.b.x) and (r.a.y <= self.y <= r.b.y): - return 'точка внутри прямоуголника' - else: - return 'точка вне прямоугольника' + def if_inside(self, r): + if (r.a.x <= self.x <= r.b.x) and (r.a.y <= self.y <= r.b.y): + return 'точка внутри прямоуголника' + return 'точка вне прямоугольника' - def __init__(self, x:int, y:int): - self.x = x - self.y = y + def __init__(self, x:int, y:int): + self.x = x + self.y = y - def __str__(self): - return 'x = ' + str(self.x) + ' y = ' + str(self.y) + def __str__(self): + return 'x = ' + str(self.x) + ' y = ' + str(self.y) class Rect(): def area(self):