Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vector:
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def cross(v1, v2):
- return v1.x * v2.y - v2.x * v1.y
- def main():
- Ax, Ay = map(int, input().split())
- Ox, Oy = map(int, input().split())
- Bx, By = map(int, input().split())
- Px, Py = map(int, input().split())
- OP = Vector(Px - Ox, Py - Oy)
- OA = Vector(Ax - Ox, Ay - Oy)
- OB = Vector(Bx - Ox, By - Oy)
- if cross(OB, OA) < 0:
- if cross(OA, OP) >= 0 and cross(OP, OB) >= 0:
- print('YES')
- else:
- print('NO')
- else:
- if cross(OB, OP) >= 0 and cross(OP, OA) >= 0:
- print('YES')
- else:
- print('NO')
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement