Advertisement
7XP

Untitled

7XP
Feb 12th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. a = list(map(float, input().split()))
  2. x = a[0]
  3. y = a[1]
  4. u = a[2]
  5. g = a[3]
  6. c = a[4]
  7. d = a[5]
  8.  
  9.  
  10.  
  11. class Vector:
  12. def __init__(self, x, y):
  13. self.x = x
  14. self.y = y
  15. def __mul__(left,right):
  16. return (left.x * right.y - left.y * right.x)
  17. def __add__(left, right):
  18. return(left.x * right.x + left.y * right.y)
  19.  
  20. a = Vector(c - u, d - g)
  21. b = Vector(x - u, y - g)
  22. f = Vector(u - c, g - d)
  23. j = Vector(x - c, y - d)
  24.  
  25. if (a * b) == 0 and (a + b) >= 0 and (f + j)>=0:
  26. print('YES')
  27. else:
  28. print('NO')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement