Program to calculate area of a parallelogram | C ++ 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 ; Driver Code ; Given diagonal and angle ; Function call ; Print the area
#include <bits/stdc++.h> NEW_LINE using namespace std ; double toRadians ( int degree ) { double pi = 3.14159265359 ; return ( ( double ) degree * ( pi / 180 ) ) ; } double Area_Parallelogram1 ( int a , int b , int theta ) { double area = ( abs ( tan ( toRadians ( theta ) ) ) / 2 ) * abs ( a * a - b * b ) ; return area ; } double Area_Parallelogram2 ( int a , int b , int gamma ) { double area = ( abs ( sin ( toRadians ( gamma ) ) ) ) * abs ( a * b ) ; return area ; } static double Area_Parallelogram3 ( int d1 , int d2 , int theta ) { double area = ( abs ( sin ( toRadians ( theta ) ) ) / 2 ) * abs ( d1 * d2 ) ; return area ; } int main ( ) { int d1 = 3 ; int d2 = 5 ; int theta = 90 ; double area = Area_Parallelogram3 ( d1 , d2 , theta ) ; printf ( " % .2f " , area ) ; }