diff --git a/__pycache__/more_class.cpython-312.pyc b/__pycache__/more_class.cpython-312.pyc index 410bbfc..4752737 100644 Binary files a/__pycache__/more_class.cpython-312.pyc and b/__pycache__/more_class.cpython-312.pyc differ 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):