Program to calculate area of a rhombus whose one side and diagonal are given | function to calculate the area of the rhombus ; Second diagonal ; area of rhombus ; return the area ; driver code
def area ( d1 , a ) : NEW_LINE INDENT d2 = ( 4 * ( a ** 2 ) - d1 ** 2 ) ** 0.5 NEW_LINE area = 0.5 * d1 * d2 NEW_LINE return ( area ) NEW_LINE DEDENT d = 7.07 NEW_LINE a = 5 NEW_LINE print ( area ( d , a ) ) NEW_LINE