Area of a largest square fit in a right angle triangle | Function to find the area of the biggest square ; the height or base or hypotenuse cannot be negative ; side of the square ; squaring to get the area ; Driver Code
def squareArea ( l , b , h ) : NEW_LINE INDENT if l < 0 or b < 0 or h < 0 : NEW_LINE INDENT return - 1 NEW_LINE DEDENT a = ( l * b ) / ( l + b ) NEW_LINE return a * a NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT l , b , h = 5 , 12 , 13 NEW_LINE print ( round ( squareArea ( l , b , h ) , 4 ) ) NEW_LINE DEDENT