Length of diagonal of a parallelogram using adjacent 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
function Length_Diagonal ( a , b , theta ) { var diagonal = Math . sqrt ( ( Math . pow ( a , 2 ) + Math . pow ( b , 2 ) ) - 2 * a * b * Math . cos ( theta * ( Math . PI / 180 ) ) ) ; return diagonal ; } var a = 3 ; var b = 5 ; var theta = 45 ; var ans = Length_Diagonal ( a , b , theta ) ; document . write ( ans . toFixed ( 2 ) ) ;