@property<EOL><INDENT>def isRectangular(self):<DEDENT>
<INDENT>two of the <NUM_LIT:4> corners are equal return false<EOL><DEDENT>upper = (self.ur - self.ul).unit<EOL>if not bool(upper):<EOL><INDENT>return False<EOL><DEDENT>right = (self.lr - self.ur).unit<EOL>if not bool(right):<EOL><INDENT>return False<EOL><DEDENT>left  = (self.ll - self.ul).unit<EOL>if not bool(left):<EOL><INDENT>return False<EOL><DEDENT>lower = (self.lr - self.ll).unit<EOL>if not bool(lower):<EOL><INDENT>return False<EOL><DEDENT>eps = <NUM_LIT><EOL><INDENT>have <NUM_LIT:4> sides of length <NUM_LIT:1.> If <NUM_LIT:3> of them have <NUM_LIT> deg angles,<EOL><DEDENT>t is a rectangle -- we check via scalar product == <NUM_LIT:0><EOL>return abs(sum(map(lambda x,y: x*y, upper, right))) <= eps andabs(sum(map(lambda x,y: x*y, upper, left))) <= eps andabs(sum(map(lambda x,y: x*y, left, lower))) <= eps<EOL>
Check if quad is rectangular.