Find area of triangle if two vectors of two adjacent sides are given | function to calculate area of triangle ; Driver Code
function area ( x1 , y1 , z1 , x2 , y2 , z2 ) { let area = Math . sqrt ( Math . pow ( ( y1 * z2 - y2 * z1 ) , 2 ) + Math . pow ( ( x1 * z2 - x2 * z1 ) , 2 ) + Math . pow ( ( x1 * y2 - x2 * y1 ) , 2 ) ) ; area = area / 2 ; return area ; } let x1 = - 2 ; let y1 = 0 ; let z1 = - 5 ; let x2 = 1 ; let y2 = - 2 ; let z2 = - 1 ; let a = area ( x1 , y1 , z1 , x2 , y2 , z2 ) ; document . write ( " " + a ) ;