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: def cross(x, y):
    return (x.conjugate() * y).imag

def is_parallel(x, y):
    if abs(cross(x, y)) < 1e-8:
        return True
    return False

n = int(input())
for i in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    a = complex(x2, y2) - complex(x1, y1)
    b = complex(x4, y4) - complex(x3, y3)    
    if is_parallel(a, b):
        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())    
    if abs( (x2 - x1) * (y4 - y3) - (y2 - y1) * (x4 - x3) ) < 1e-10:
        print('YES')
    else:
        print('NO')

Python: def points2vec(points):
    return [points[0][i]-points[1][i] for i in range(2)]

def determinant(v1, v2):
    return v1[0] * v2[1] - v1[1] * v2[0]

n = int(input())
for _ in range(n):
    it = map(float, input().split())
    points = list(zip(it, it))
    v1 = points2vec(points[:2])
    v2 = points2vec(points[2:])
    print("YES" if determinant(v1, v2) == 0.0 else "NO")

Python: def check(lst):
  x1, y1, x2, y2, x3, y3, x4, y4 = lst
  vabx, vaby = x2 - x1, y2 - y1
  vcdx, vcdy = x4 - x3, y4 - y3
  if vabx != 0:
    ratio = vcdx / vabx
    if vcdy == vaby * ratio:
      return True
    else:
      return False

  else:
    if vcdx == 0:
      return True
    else:
      return False

n = int(input())
for _ in range(n):
  plst = list(map(float, input().split()))
  print("YES" if check(plst) else "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 (s[0] - s[2]) / (s[1] - s[3]) - (s[4] - s[6]) / (s[5] - s[7]) < 1e-10:
        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((y1-y2)*(x3-x4)-(y3-y4)*(x1-x2))<1e-10 else 'NO')

Python: n = int(input())
for _ in range(n):
    x1, y1, x2, y2, x3, y3, x4, y4 = map(float, input().split())
    if abs((x2 - x1) * (y4 - y3) - (x4 - x3) * (y2 - y1)) < 1e-8:
        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 and angle1 + angle0 != 0:
        print("YES")
    else:
        print("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 x1==0:
        if x2==0:
            print("YES")
        else:
            print("NO")
    else:
        if y1/x1==y2/x2:
            print("YES")
        else:
            print("NO")

Python: n = int(input())
for i in range(n):
    a,e,b,f,c,g,d,h=map(float,input().split())
    print("YES" if abs((b-a)*(h-g)-(d-c)*(f-e)) < 1e-10 else "NO")

Python: # -*- coding:utf-8 -*-
def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    if x1 == x2 and x4 == x3:
        print('YES')
        return 0
    elif x1 == x2 or x3 == x4:
        print('NO')
        return 0
    k1 = (y2-y1)/(x2-x1)
    k2 = (y4-y3)/(x4-x3)
    if abs(k1-k2) < 1e-10:
        print('YES')
    else:
        print('NO')

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

Python: import sys

args = sys.argv

args = [int(a) for a in args]


class Point():
  def __init__(self,x,y):
      self.x = x
      self.y = y

  def __sub__(self,oth):
    self.x = self.x - oth.x
    self.y = self.y - oth.y
    return Point(self.x,self.y)

  def __str__(self):
    return "%s(%r)" %(self.__class__,self.__dict__)

for _ in range(args[0]):
  if _ == 0:
    pass
  else:
    A,B,C,D = ([Point(i,i+1) for i in range(0,8,2)])
    tmp = B - A
    tmp2 = C - D
    tmp3 = (tmp.x * tmp2.y) - (tmp.y * tmp2.x)
    if tmp3 == 0:
      print("YES")
    else:
      print("NO")

Python: if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        x1,y1,x2,y2,x3,y3,x4,y4 = map(float,input().split())
        #print((y2-y1)/(x2-x1) - (y4-y3)/(x4-x3))
        '''if math.fabs(x1 - x2) <= 0.00001 and math.fabs( x3 - x4) <= 0.00001:
            print("YES")
        elif math.fabs(x1 - x2) <= 0.00001:
            print("NO")
        elif math.fabs(x3 - x4) <= 0.00001:
            print("NO")
        else:
        '''
        if abs((x2-x1) * (y4-y3)-(x4-x3)*(y2-y1)) < 1e-10:
            print("YES")
        else:
            print("NO")

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

Python: import sys

def cross(a, b):
    return a.real * b.imag - a.imag * b.real
 
n = sys.stdin.readline()
for line in sys.stdin:
    a, b, c, d = [x + y * 1j for x, y in zip(* [map(float, line.split())] * 2)]
    print('YES' if abs(cross(a - b, c - d)) < 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())
    print('YES' if abs((x2 - x1)*(y4 - y3) - (x4 - x3)*(y2 - y1)) < 1e-10 else 'NO')

Python: n=int(input())
for _ in range(n):
    a,b,c,d,e,f,g,h=map(float, input().split())
    if (b-d)/(a-c) == (f-h)/(e-g):
        print("Yes")
    else:
        print("No")

Python: import sys

n = int(input())
for s in range(n):
    x1,y1,x2,y2,x3,y3,x4,y4 = map(float, input().strip().split())
    angle1 = (y2-y1)/(x2-x1)
    angle2 = (y4-y3)/(x4-x3)
    if angle1 == angle2:
        print("YES")
    else:
        print("NO")

Python: # AOJ 0021: Parallelism
# Python3 2018.6.15 bal4u

n = int(input())
for i in range(n):
	asx, asy, aex, aey, bsx, bsy, bex, bey = list(map(float, input().split()))
	if (asx == aex and asy == aey) or (bsx == bex and bsy == bey): print('NO')
	elif abs((asy-aey)*(bsx-bex)-(asx-aex)*(bsy-bey)) < 1e-8: print('YES')
	else: print('NO')

Python: def check_para(x1,y1,x2,y2,x3,y3,x4,y4):
    if (x1 - x2) * (y3 - y4) - (x3 - x4) * (y1 - y2) > 1e-10:
        print("NO")
        return
    else:
        print("YES")
        return

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

Python: n = int(input())
for i in range(n):
    a,e,b,f,c,g,d,h=list(map(float,input().split()))
    print("YES" if abs((b-a)*(d-c)-(h-g)*(f-e)) < 1e-10 else "NO")

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