Created
August 29, 2014 19:15
-
-
Save kg86/91014c7e9295b21e82c6 to your computer and use it in GitHub Desktop.
Revisions
-
kg86 created this gist
Aug 29, 2014 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ #! -*- 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'