for _ in range(int(input())): a,b,c,d,e,f,g,h = map(int,input().split()) i = (a-c)**2+(b-d)**2>(e-g)**2+(f-h)**2 j = (a-c)*(f-h)==(b-d)*(e-g) print("Yes" if i and j else "No")