Skip to content

Instantly share code, notes, and snippets.

@kg86
Created August 29, 2014 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kg86/2e8daa3f44b841556b3b to your computer and use it in GitHub Desktop.
Save kg86/2e8daa3f44b841556b3b to your computer and use it in GitHub Desktop.
#! -*- coding: utf-8-unix -*-
import math
if __name__=='__main__':
n = int(raw_input())
for i in xrange(n):
x1, y1, x2, y2, x3, y3, x4, y4 = map(float, raw_input().strip().split(' '))
if math.fabs((y2 - y1) * (x4 - x3) - (y4 - y3) * (x2 - x1)) < 1e-10:
print 'YES'
else:
print 'NO'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment