Length of diagonal of a parallelogram using adjacent sides and angle between them | Python3 Program to find length Of diagonal of a parallelogram Using sides and angle between them . ; Function to return the length Of diagonal of a parallelogram using sides and angle between them . ; Given Sides ; Given Angle ; Function Call ; Print the final answer
import math NEW_LINE def Length_Diagonal ( a , b , theta ) : NEW_LINE INDENT diagonal = math . sqrt ( ( ( a ** 2 ) + ( b ** 2 ) ) - 2 * a * b * math . cos ( math . radians ( theta ) ) ) NEW_LINE return diagonal NEW_LINE DEDENT a = 3 NEW_LINE b = 5 NEW_LINE theta = 45 NEW_LINE ans = Length_Diagonal ( a , b , theta ) NEW_LINE print ( round ( ans , 2 ) ) NEW_LINE