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