import sys input = lambda :sys.stdin.readline()[:-1] ni = lambda :int(input()) na = lambda :list(map(int,input().split())) yes = lambda :print("yes");Yes = lambda :print("Yes") no = lambda :print("no");No = lambda :print("No") ####################################################################### t = ni() def sub(a, b): return (a[0] - b[0], a[1] - b[1]) def det(a, b): return a[0]*b[1] - a[1]*b[0] def parallel(a, b, c, d): return det(sub(a, b), sub(c, d)) == 0 def norm(a): return a[0] ** 2 + a[1] ** 2 def dist(a, b): return norm(sub(a, b)) for _ in range(t): a = na() p1, p2 = a[0:2], a[2:4] q1, q2 = a[4:6], a[6:8] if (parallel(p1, p2, q1, q2) and dist(p1, p2) > dist(q1, q2)) or (p1 == q1 and p2 == q2): Yes() else: No()