Created
August 29, 2014 19:15
-
-
Save kg86/2e8daa3f44b841556b3b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! -*- 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