#include <iostream>
#include <cmath>
#include <utility>
using namespace std;


int main(){
	int n;
	pair<double, double> a, b, c, d;
	
	cin >> n;
	
	for(int i = 0;i < n;i++){
		cin >> a.first >> a.second;
		cin >> b.first >> b.second;
		cin >> c.first >> c.second;
		cin >> d.first >> d.second;
		
		double x1 = b.first - a. first;
		double y1 = b.second - a.second;
		double x2 = d.first - c.first;
		double y2 = d.second - c.second;
		
		cout << x1 << ' ' << y1 << ' ' << x2 << ' ' << y2 << endl;
		
		cout << atan2(y1, x1) << ' ' << atan2(y2, x2) << endl;
		
		if(abs((atan2(y1, x1) - atan2(y2, x2))) < 0.0000001) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	
	return 0;
}