Length of a Diagonal of a Parallelogram using the length of Sides and the other Diagonal | Python Program to implement the above approach ; Function to calculate the length of the diagonal of a parallelogram using two sides and other diagonal ; Driver Code ; Function Call ; Print the final answer
import math NEW_LINE def Length_Diagonal ( a , b , d ) : NEW_LINE INDENT diagonal = math . sqrt ( 2 * ( ( a ** 2 ) + ( b ** 2 ) ) - ( d ** 2 ) ) NEW_LINE return diagonal NEW_LINE DEDENT A = 10 NEW_LINE B = 30 NEW_LINE D = 20 NEW_LINE ans = Length_Diagonal ( A , B , D ) NEW_LINE print ( round ( ans , 2 ) ) NEW_LINE