Program to calculate area of a rhombus whose one side and diagonal are given | Java program to calculate the area of a rhombus whose one side and one diagonal is given ; function to calculate the area of the rhombus ; Second diagonal ; area of rhombus ; return the area ; Driver code
class GFG { static double area ( double d1 , double a ) { double d2 = Math . sqrt ( 4 * ( a * a ) - d1 * d1 ) ; double area = 0.5 * d1 * d2 ; return area ; } public static void main ( String [ ] args ) { double d = 7.07 ; double a = 5 ; System . out . println ( area ( d , a ) ) ; } }