Program to calculate area and perimeter of a rhombus whose diagonals are given | calculate area and perimeter of a rhombus ; Driver code
function rhombusAreaPeri ( d1 , d2 ) { let area , perimeter ; area = Math . floor ( ( d1 * d2 ) / 2 ) ; perimeter = Math . floor ( 2 * Math . sqrt ( Math . pow ( d1 , 2 ) + Math . pow ( d2 , 2 ) ) ) ; document . write ( " " + d1 + " " + d2 + " " + area + " " + " " ) ; document . write ( " " + d1 + " " + d2 + " " + perimeter + " " + " " ) ; } let d1 = 2 , d2 = 4 ; rhombusAreaPeri ( d1 , d2 ) ;