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")
		}
	}
}

Python: #!/usr/bin/env python3
# -*- coding: utf-8 -*-


import collections
import math


LIMIT = 0.0000001


class Vector2(collections.namedtuple("Vector2", "x y")):

    __slots__ = ()

    def __add__(self, other):
        return Vector2(self.x + other.x, self.y + other.y)

    def __sub__(self, other):
        return Vector2(self.x - other.x, self.y - other.y)

    def __mul__(self, other):
        return self.x * other.y - self.y * other.x

    def __neg__(self):
        return Vector2(-self.x, -self.y)

    def __pos__(self):
        return Vector2(+self.x, +self.y)

    def __abs__(self):
        return math.sqrt(float(self.x * self.x + self.y * self.y))

    def dotproduct(self, other):
        return self.x * other.x + self.y * other.y


def main():
    n = int(input())
    for i in range(n):
        [x1, y1, x2, y2, x3, y3, x4, y4] = [float(z) for z in input().split()]
        vector_ab = Vector2(x2 - x1, y2 - y1)
        vector_cd = Vector2(x4 - x3, y4 - y3)
        if abs(vector_ab * vector_cd) < LIMIT:
            print("YES")
        else:
            print("NO")


if __name__ == "__main__":
    main()

Python: import sys
cases = int(input())
i = 0
while i < cases:
   #for line in sys.stdin.readlines():
   x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = map(float,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   k=dy1*dx2
   l=dy2*dx1
   if( k==l ):
       print("YES")
   else:
       print("NO")
   i += 1

Python: n = int(input())
for i in range(n):
	line = list(map(float,input().split()))
	if round(line[2] - line[0], 7) == 0:
		if round(line[6] - line[4], 7) == 0:
			print("YES")
		else:
			print("NO")
	elif round(line[6] - line[4], 7) == 0:
		pass
	else:
		AB = (line[3] - line[1]) / (line[2] - line[0])
		CD = (line[7] - line[5]) / (line[6] - line[4])
		if round(AB - CD, 11) == 0:
			print("YES")
		else:
			print("NO")

Python: n = int(input())
for i in range(n):
    p = list(map(float, input().split()))
    print("YES" if abs((p[3] - p[1]) * (p[6] - p[4]) - (p[7] - p[5]) * (p[2] - p[0])) < 1e-10 else "NO")

Python: while True:
    try:
        a=[float(i) for i in input().split()]
    except:
        break
    dx1=a[2]-a[0]
    dy1=a[3]-a[1]
    dx2=a[6]-a[4]
    dy2=a[7]-a[5]
    if dx1==0 and dx2==0 or dy1/dx1==dy2/dx2:
        print("YES")
    else:
        print("NO")

Python: import math
N=range(int(raw_input()))
for i in N:
    a,w,b,x,c,y,d,z=map(float, raw_input().split())
    print ["NO","YES"][abs((w-x)*(c-d)-(y-z)*(a-b))<1e-8]

Python: # -*- coding:utf-8 -*-

def main():
    for i in range(int(input())):
        x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())

        if abs((x2-x1)*(y4-y3)-(x4-x3)*(y2-y1))<1e-10:
            print("YES")
        else:
            print("NO")
    
        
if __name__ == '__main__':
    main()

Python: for i in range(int(input())):
    s = list(map(float,input().split()))
    if (s[0] - s[2]) * (s[5] - s[7]) == (s[4] - s[6]) * (s[1] - s[3]):
        print('YES')
    else:
        print('NO')

Python: import sys
import math

n = int(input())
for s in range(n):
    pos = list(map(float, input().split()))
    if pos[0] == pos[2] or pos[4] == pos[6]:
        angle1 = 0
        angle2 = 0
    else:
        angle1 = (pos[3]-pos[1])/(pos[2]-pos[0])
        angle2 = (pos[7]-pos[5])/(pos[6]-pos[4])
    if abs(angle1 - angle2) <= 1e-10:
        print("YES")
    else:
        print("NO")

Python: for i in range(int(input())):
    s = list(map(float,input().split()))
    if s[1] - s[3] == 0 or s[5] - s[7] == 0:
        if s[1] - s[3] == s[5] - s[7] == 0:
            print('YES')
        else:
            print('NO')
    elif abs((s[0] - s[2]) / (s[1] - s[3]) - (s[4] - s[6]) / (s[5] - s[7])) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: for _ in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print(["NO","YES"][abs((x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2)) < 10e-4])

Python: import sys

lines = sys.stdin.readlines()
size = int(lines[0])
data = lines[1:len(lines)]
for line in data:
    line = line.split(" ")
    inp = []
    for i in line:
        inp.append(float(i))
    x = []
    x.append(inp[0])
    x.append(inp[2])
    x.append(inp[4])
    x.append(inp[6])
    y = []
    y.append(inp[1])
    y.append(inp[3])
    y.append(inp[5])
    y.append(inp[7])
    tilt1 = (y[1]-y[0])/(x[1]-x[0])
    tilt2 = (y[3]-y[2])/(x[3]-x[2])
    if tilt1==tilt2:
        print ("YES")
    else:
        print ("NO")

Python: for i in range(int(input())):
    x1,y1,x2,y2,x3,y3,x4,y4=map(lambda x: int(100000*float(x)),input().split())
    if (x1-x2)*(y3-y4)==abs((y1-y2)*(y3-y4)):
        print("YES")
    else:
        print("NO")

Python: import sys
cases = int(input())
i = 0
while i < cases:
   #for line in sys.stdin.readlines():
   x1 , y1 , x2 , y2 , x3 , y3 , x4 , y4 = map(float,input().split())
   dy1 = y2 - y1
   dy2 = y4 - y3
   dx1 = x2 - x1
   dx2 = x4 - x3
   if(dy1*dx2 == dy2*dx1):
       print("YES")
   else:
       print("NO")
   i += 1

Python: ABs=[]
CDs=[]
n = int(input())
for i in range(n):
    x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4, = map(float, input().split())
    AB = [x_2 - x_1, y_2 - y_1]
    CD = [x_4 - x_3, y_4 - y_3]
    ABs.append(AB)
    CDs.append(CD)
for i in range(n):
    if ABs[i][0]*CDs[i][1]==ABs[i][1]*CDs[i][0]:
        print("YES")
    else:
        print("NO")

Python: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    print('YES' if abs((x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1)) < 1e-10 else 'NO')

Python: count = int(input())
for i in range(count):
    x = list(map(float ,input().split()))
    x1=x[2]-x[0]
    y1=x[3]-x[1]
    x2=x[6]-x[4]
    y2=x[7]-x[5]
    if abs(x1)<=0.00001:
        if abs(x2)<=0.00001:
            print("YES")
        else:
            print("NO")
    elif abs(y1)<=0.00001:
        if abs(y2)<=0.00001:
            print("YES")
        else:
            print("NO")
    else:
        if format(y1/x1,'.5f')==format(y2/x2,'.5f'):
            print("YES")
        else:
            print("NO")

Python: n = int(input())
for i in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4=map(float,input().split())
    print("YES" if abs((y2-y1)*(x4-x3)-(x2-x1)*(y4-y3)) < 1e-10 else "NO")

Python: n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if abs((y1 - y2) / (x1 - x2) - (y4 - y3)/ (x4 - x3)) < 1e-10: print("YES")
    else: print("NO")

Python: import math


def equal(x, y):
    return math.fabs(x - y) <= 10 ** (-10)


def spam(_x1, _y1, _x2, _y2):
    if _x1 > _x2:
        return _x1, _y1, _x2, _y2
    else:
        return _x2, _y2, _x1, _y1


for i in range(int(input())):
    x1, y1, x2, y2, x3, y3, x4, y4 = list(map(float, input().split()))
    b1 = (x1 - x2, y1 - y2)
    b2 = (x3 - x4, y3 - y4)
    p = 0 if b2[0] != 0 else 1
    q = 1 if b2[0] != 0 else 0

    t = b1[p]/b2[p]
    if equal(b1[q], b2[q] * t):
        print('YES')
    else:
        print('NO')

Python: num=int(input())
for i in range (num):
    info=list(map(float,input().split()))
    if info[2]==info[0]:
        if info[6]==info[4]:
            print("YES")
        else:
            print("NO")
    else:
        if (info[3]-info[1])/(info[2]-info[0])==(info[7]-info[5])/(info[6]-info[4]):
            print("YES")
        else:
            print("NO")