Angle between two Planes in 3D | Function to find Angle ; Driver Code
function distance ( a1 , b1 , c1 , a2 , b2 , c2 ) { var d = a1 * a2 + b1 * b2 + c1 * c2 ; var e1 = Math . sqrt ( a1 * a1 + b1 * b1 + c1 * c1 ) ; var e2 = Math . sqrt ( a2 * a2 + b2 * b2 + c2 * c2 ) ; d = parseFloat ( d / ( e1 * e2 ) ) ; var pi = 3.14159 ; var A = ( 180 / pi ) * Math . acos ( d ) ; document . write ( " " + A . toFixed ( 1 ) + " " ) ; } var a1 = 1 ; var b1 = 1 ; var c1 = 2 ; var d1 = 1 ; var a2 = 2 ; var b2 = - 1 ; var c2 = 1 ; var d2 = - 4 ; distance ( a1 , b1 , c1 , a2 , b2 , c2 ) ;