Advertisement
Guest User

Untitled

a guest
Nov 15th, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. a = input()
  2. b = input()
  3. c = input()
  4. d = input()
  5. x1 = int(a.split()[0])
  6. y1 = int(a.split()[1])
  7. x2 = int(b.split()[0])
  8. y2 = int(b.split()[1])
  9. x3 = int(c.split()[0])
  10. y3 = int(c.split()[1])
  11. x4 = int(d.split()[0])
  12. y4 = int(d.split()[1])
  13. s = abs((x1*(y3-y2)+x2*(y1-y3)+x3*(y2-y1))/2)
  14. s1= abs((x4*(y1-y2)+x2*(y1-y4)+x1*(y4-y2))/2)
  15. s2 = abs((x4*(y3-y2)+x2*(y4-y3)+x3*(y2-y4))/2)
  16. s3 = abs((x4*(y3-y1)+x1*(y4-y3)+x3*(y4-y1))/2)
  17. if s == s1+s2+s3:
  18.   print('In')
  19. else:
  20.   print('Out')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement