def gcd(a,b): while b!=0: r=a%b a,b=b,r return abs(a) def eval(xa,ya,xc,yc,xb,yb,xd,yd): s=(xa-xb)*(yc-ya)-(ya-yb)*(xc-xa) t=(xa-xb)*(yd-ya)-(ya-yb)*(xd-xa) if s*t>0:return False s=(xc-xd)*(ya-yc)-(yc-yd)*(xa-xc) t=(xc-xd)*(yb-yc)-(yc-yd)*(xb-xc) if s*t>0:return False True T=int(input()) for _ in range(T): x1,y1,x2,y2,X1,Y1,X2,Y2=list(map(int,input().split())) if eval(x1,y1,x2,y2,X1,Y1,X2,Y2): print("No") continue diff_x1=x1-X1 diff_y1=y1-Y1 diff_x2=x2-X2 diff_y2=y2-Y2 g1=gcd(diff_x1,diff_y1) g2=gcd(diff_x2,diff_y2) diff_x1//=g1 diff_y1//=g1 diff_x2//=g2 diff_y2//=g2 if diff_x1==-diff_x2 and diff_y1==diff_y2:print("Yes") elif diff_x1==diff_x2 and diff_y1==-diff_y2:print("Yes") else:print("No")