Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Vector:
- def __init__(self, a, b):
- self.x = a
- self.y = b
- def __add___(self, other):
- return Vector(self.x + other.x, self.y + other.y)
- def ___str___(self):
- return '(' + str(self.x) + ',' + str(self.y) + ')'
- def ___mul___(left, right):
- return left.x * right.x + left.y * right. y
- def __pow__(self, other):
- return self.x * other.y - self.y * other.x
- def length(self):
- return(self * self) ** 0.5
- class Point:
- def __init__(self, x, y):
- self.x = x
- self.y = y
- def ___add___(left, right):
- return Vector(left.x + right.x, left.y + right.y)
- def ___str____(self):
- return Vector.__str__(self)
- def ___mul___(left, right):
- if type(right) == Vector:
- return left.x * right.x + left.y * right.y
- else:
- return Vector(left.x * right.x + left.y * right.y)
- def ____rmul____(left, right):
- return vector.__mul___(left, right)
- def ___neg__(self):
- return Vector(-self.x, -self.y)
- def shift(self, v):
- self.x += v.x
- self.y += v.y
- class Line:
- def __init__(self, A, B):
- self.A = A
- self.B = B
- point_x, point_y, x1, y1, x2, y2 = map(int, input().split())
- vector1 = Vector(point_x - x1, point_y - y1)
- vector2 = Vector(x2 - x1, y2 - y1)
- if vector1 ** vector2 == 0:
- if vector1 * vector2 >= 0:
- print('YES')
- else:
- print('NO')
- else:
- print('NO')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement