Function to check if the triangle is right - angled or not
def ifRight ( x1 , y1 , x2 , y2 , x3 , y3 ) : NEW_LINE INDENT a = ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) NEW_LINE b = ( ( x1 - x3 ) * ( x1 - x3 ) ) + ( ( y1 - y3 ) * ( y1 - y3 ) ) NEW_LINE c = ( ( x2 - x3 ) * ( x2 - x3 ) ) + ( ( y2 - y3 ) * ( y2 - y3 ) ) NEW_LINE if ( ( a == ( b + c ) and a != 0 and b != 0 and c != 0 ) or ( b == ( a + c ) and a != 0 and b != 0 and c != 0 ) or ( c == ( a + b ) and a != 0 and b != 0 and c != 0 ) ) : NEW_LINE INDENT return 1 NEW_LINE DEDENT DEDENT