T=int(input()) for t in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=map(int,input().split()) dx,dy=x2-x1,y2-y1 dX,dY=X2-X1,Y2-Y1 if (x1,y1,x2,y2)==(X1,Y1,X2,Y2): ans="Yes" elif dx*dX+dy*dY>=0 and (dx*dX+dy*dY)**2==(dx**2+dy**2)*(dX**2+dY**2) and (dx**2+dy**2)>(dX**2+dY**2): ans="Yes" else: ans="No" print(ans)