Find area of parallelogram if vectors of two adjacent sides are given | C ++ code to calculate area of parallelogram if vectors of 2 adjacent sides are given ; Function to calculate area of parallelogram ; Driver Code
#include <bits/stdc++.h> NEW_LINE using namespace std ; float area ( float x1 , float y1 , float z1 , float x2 , float y2 , float z2 ) { float area = sqrt ( pow ( ( y1 * z2 - y2 * z1 ) , 2 ) + pow ( ( x1 * z2 - x2 * z1 ) , 2 ) + pow ( ( x1 * y2 - x2 * y1 ) , 2 ) ) ; return area ; } int main ( ) { float x1 = 3 ; float y1 = 1 ; float z1 = -2 ; float x2 = 1 ; float y2 = -3 ; float z2 = 4 ; float a = area ( x1 , y1 , z1 , x2 , y2 , z2 ) ; cout << " Area ▁ = ▁ " << a ; return 0 ; }