from more_class import Rect
from more_class import PointXY

p1 = PointXY(-10, -10)
p2 = PointXY(10, 10)
pz = PointXY(0, 0)
pa = PointXY(15, 15)
pb = PointXY(-15, 15)
pc = PointXY(-15, -15)
pd = PointXY(15, 15)
points = [pz, pa, pb, pc, pd]

# __str__
r1 = Rect(p1, p2)
print(r1, '\n')

r2 = Rect(20, 20)
print(r2, '\n')

print('distance_from_zero', p1.distance_from_zero())
print('distance_to', p1.distance_to(p2))

print('area (from width and lenght)', r2.area())
print('perimeter (from width and lenght)', r2.perimeter())
print('area (from PointXY)', r1.area())
print('perimeter (from PointXY)', r1.perimeter())
r2.rotate()
print('rotate', r2)
r2.scale
print('scale', r2)


print('has_inside')
for point in points:
    print(r1.has_inside(point))

print()
print('if_inside')
for point in points:
    print(point.if_inside(r1))



