Program to calculate area of a parallelogram | Javascript program for the above approach ; Function to return the area of parallelogram using sides and angle at the intersection of diagonal ; Calculate area of parallelogram ; Return the answer ; Function to return the area of parallelogram using sides and angle at the intersection of sides ; Calculate area of parallelogram ; Return the answer ; Function to return the area of parallelogram using diagonals and angle at the intersection of diagonals ; Calculate area of parallelogram ; Return the answer ; Given diagonal and angle ; Function call ; Print the area
function toRadians ( degree ) { let pi = 3.14159265359 ; return ( degree * ( pi / 180 ) ) ; } function Area_Parallelogram1 ( a , b , theta ) { let area = ( Math . abs ( Math . tan ( toRadians ( theta ) ) ) / 2 ) * Math . abs ( a * a - b * b ) ; return area ; } function Area_Parallelogram2 ( a , b , gamma ) { let area = ( Math . abs ( Math . sin ( toRadians ( gamma ) ) ) ) * Math . abs ( a * b ) ; return area ; } function Area_Parallelogram3 ( d1 , d2 , theta ) { let area = ( Math . abs ( Math . sin ( toRadians ( theta ) ) ) / 2 ) * Math . abs ( d1 * d2 ) ; return area ; } let d1 = 3 ; let d2 = 5 ; let theta = 90 ; let area = Area_Parallelogram3 ( d1 , d2 , theta ) ; document . write ( area ) ;