Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- class Vector:
- def __init__(self, x_, y_):
- self.x = x_
- self.y = y_
- def __len__(self):
- return math.hypot(self.x, self.y)
- def __mul__(self, other):
- return self.x * other.x + self.y * other.y
- def __add__(self, other):
- return Vector(self.x + other.x, self.y + other.y)
- def angle(self, other):
- return math.acos(self * other / len(self) / len(other))
- x1, y1 = map(int, input().split())
- x2, y2 = map(int, input().split())
- x3, y3 = map(int, input().split())
- a = Vector(x1, y1)
- b = Vector(x2, y2)
- c = Vector(x3, y3)
- a = len(a)
- b = len(b)
- c = len(c)
- a, b, c = sorted([a, b, c])
- if a ** 2 + b ** 2 == c ** 2:
- print('прямоугольный')
- elif a ** 2 + b ** 2 < c ** 2:
- print('тупоугольный')
- else:
- print('остроугольный')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement