Find if it 's possible to rotate the page by an angle or not. | Function to find if it 's possible to rotate page or not ; Calculating distance b / w points ; If distance is not equal ; If the points are in same line ; Points a , b , and c
def possibleOrNot ( a1 , a2 , b1 , b2 , c1 , c2 ) : NEW_LINE INDENT dis1 = ( pow ( b1 - a1 , 2 ) + pow ( b2 - a2 , 2 ) ) NEW_LINE dis2 = ( pow ( c1 - b1 , 2 ) + pow ( c2 - b2 , 2 ) ) NEW_LINE if ( dis1 != dis2 ) : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT elif ( b1 == ( ( a1 + c1 ) // 2.0 ) and b2 == ( ( a2 + c2 ) // 2.0 ) ) : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT DEDENT a1 , b1 , c1 = 1 , 2 , 3 NEW_LINE a2 = b2 = c2 = 0 NEW_LINE possibleOrNot ( a1 , a2 , b1 , b2 , c1 , c2 ) NEW_LINE