SHARE
TWEET

Untitled

a guest May 26th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import math
  2.  
  3.  
  4. class Vector:
  5.  
  6.     def __init__(self, x_, y_):
  7.         self.x = x_
  8.         self.y = y_
  9.  
  10.     def __len__(self):
  11.         return math.hypot(self.x, self.y)
  12.  
  13.     def __mul__(self, other):
  14.         return self.x * other.x + self.y * other.y
  15.  
  16.     def __add__(self, other):
  17.         return Vector(self.x + other.x, self.y + other.y)
  18.  
  19.     def angle(self, other):
  20.         return math.acos(self * other / len(self) / len(other))
  21.  
  22.  
  23. x1, y1 = map(int, input().split())
  24. x2, y2 = map(int, input().split())
  25. x3, y3 = map(int, input().split())
  26. a = Vector(x1, y1)
  27. b = Vector(x2, y2)
  28. c = Vector(x3, y3)
  29. a = len(a)
  30. b = len(b)
  31. c = len(c)
  32. a, b, c = sorted([a, b, c])
  33. if a ** 2 + b ** 2 == c ** 2:
  34.     print('прямоугольный')
  35. elif a ** 2 + b ** 2 < c ** 2:
  36.     print('тупоугольный')
  37. else:
  38.     print('остроугольный')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top