Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. class Vector:
  2. def __init__(self, a, b):
  3. self.x = b.x - a.x
  4. self.y = b.y - a.y
  5.  
  6. def __mul__(self, vect):
  7. return self.x * vect.x + self.y * vect.y
  8. __rmul__ = __mul__
  9.  
  10. def __str__(self):
  11. return '(' + str(self.x) + ',' + str(self.y) + ')'
  12.  
  13. def __pow__(self, vect):
  14. return self.x * vect.y - vect.x * self.y
  15.  
  16.  
  17. class Point:
  18. def __init__ (self, a, b):
  19. self.x = a
  20. self.y = b
  21. __str__ = Vector.__str__
  22.  
  23.  
  24. x1, y1, x2, y2, x3, y3 = map(int, input().split())
  25. A = Point(x1, y1)
  26. B = Point(x2, y2)
  27. C = Point(x3, y3)
  28. first_vector = Vector(B, C)
  29. second_vector = Vector(B, A)
  30. third_vector = Vector(A, B)
  31. forth_vector = Vector(A, C)
  32. if first_vector ** second_vector == 0:
  33. if third_vector * forth_vector <= 0:
  34. print("YES")
  35. else:
  36. print("NO")
  37. else:
  38. print("NO")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement