T=int(input()) for tests in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split()) if (x1,y1,x2,y2)==(X1,Y1,X2,Y2): print("Yes") continue dis1=(x1-x2)**2+(y1-y2)**2 dis2=(X1-X2)**2+(Y1-Y2)**2 if (x2-x1)*(Y2-Y1)!=(y2-y1)*(X2-X1) or (x2-x1)*(X2-X1)<0 or (y2-y1)*(Y2-Y1)<0: print("No") else: if dis2