Go: package main

import "fmt"

func abs(x float64) float64 {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	var n int
	var x1, y1, x2, y2, x3, y3, x4, y4 float64
	fmt.Scan(&n)
	for i := 0 ; i < n; i++ {
		fmt.Scanf("%f %f %f %f %f %f %f %f", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4)
		if abs((x2-x1)*(y4-y3) - (y2-y1)*(x4-x3)) < 1e-10 {
			fmt.Println("YES")
		} else {
			fmt.Println("NO")
		}
	}
}

C++: #include<stdio.h>

int main(void){
	int n,i;
	float ax,ay,bx,by,cx,cy,dx,dy;
	float datax_1,datax_2,datay_1,datay_2;

	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%f %f %f %f %f %f %f %f",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy);
		datax_1=bx-ax;
		datax_2=dx-cx;
		datay_1=by-ay;
		datay_2=dy-cy;
		if(datax_1==datax_2 && datay_1==datay_2)
			printf("YES\n");
		else if(datax_1*(-1)==datax_2 && datay_1*(-1)==datay_2)
			printf("YES\n");
		else
			printf("No\n");
	}

	return 0;
}

C++: #include<stdio.h>
int main(){
	int n,i;
	float x1,y1,x2,y2,x3,y3,x4,y4;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%f%f%f%f%f%f%f%f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4);
		if(((x2-x1)/(x4-x3))==((y2-y1)/(y4-y3))){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
	double x[4],y[4],N;
	cin>>N;
	while(N--){
		for(int i=0;i<4;i++) cin>>x[i]>>y[i];
		if((x[0]-x[1])*(y[2]-y[3])==(x[2]-x[3])*(y[0]-y[1]))
		cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		float x[4], y[4];
		for(int j = 0; j < 4; j++){
			cin >> x[j] >> y[j];
		}
		float ab = 99999999, cd = 99999999;
		if(x[0] != x[1]) ab = (y[0]-y[1]) / (x[0]-x[1]);
		if(x[2] != x[3]) cd = (y[2]-y[3]) / (x[2]-x[3]);
		if(ab == cd) cout << "YES"<< endl;
		else cout << "NO" << endl;
	}
	return 0;
}

C++: 
#include <iostream>
#include <complex>
#include <cmath>

using namespace std;

typedef complex<double> Point;

int main() {
    int N;
    cin >> N;
    while(N--) {
        Point ps[4];
        for(int i = 0; i < 4; ++i) cin >> ps[i].real() >> ps[i].imag();
        Point v1 = ps[1]-ps[0], v2 = ps[3]-ps[2];
        /*
        double dot = v1.real()*v2.real() + v1.imag()*v2.imag();
        double n = norm(v1) * norm(v2);
        if(abs(dot*dot - n) < 1e-5) cout << "YES" << endl;
        else cout << "NO" << endl;
        */
        if(abs(arg(v1)-arg(v2)) < 1e-2) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
struct Coordinate {
	double x;
	double y;
};
vector<bool>l;
int main() {
	Coordinate A, B, C, D;
	double Inclination_of_AB;
	double Inclination_of_CD;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> A.x >> A.y >> B.x >> B.y;
		Inclination_of_AB = (B.x - A.x) / (B.y - A.y);
		cin >> C.x >> C.y >> D.x >> D.y;
		Inclination_of_CD = (D.x - C.x) / (D.y - C.y);
		l.push_back(Inclination_of_AB == Inclination_of_CD);
	}
	for (bool i : l) {
		if (i) cout << "YES";
		else cout << "NO";
		cout << std::endl;
	}
	char c;
	cin >> c;
}

C++: #include <iostream>
using namespace std;

int main() {

  int n;
  cin >> n;

  for ( int i = 0; i < n; i++ ) {

    double x[4],y[4];
    cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2] >> x[3] >> y[3];

    if ( ( x[0] - x[1] ) * ( x[2] - x[3] ) == 0.00 ) {

      if ( x[0] == x[1] && x[2] == x[3] ) {
	cout << "YES" << endl;
      }else {
	cout << "NO" << endl;
      }

    }else {

      if ( ( y[1] - y[0] ) / ( x[1] - x[0] ) == ( y[3] - y[2] ) / ( x[3] - x[2] ) ) {
	cout << "YES" << endl;
      }else {
	cout << "NO" << endl;
      }

    }

  }

  return 0;

}