Length of diagonals of a Rhombus using length of Side and vertex Angle | Function to calculate the length of diagonals of a rhombus using length of sides and vertex angle ; Driver Code
function Length_Diagonals ( a , theta ) { let p = a * Math . sqrt ( 2 + ( 2 * Math . cos ( theta * ( Math . PI / 180 ) ) ) ) ; let q = a * Math . sqrt ( 2 - ( 2 * Math . cos ( theta * ( Math . PI / 180 ) ) ) ) ; return [ p , q ] ; } let A = 6 ; let theta = 45 ; let ans = Length_Diagonals ( A , theta ) ; document . write ( ans [ 0 ] . toFixed ( 2 ) + " " + ans [ 1 ] . toFixed ( 2 ) ) ;