Find interior angles for each side of a given Cyclic Quadrilateral | Function to find the interior angles of the cyclic quadrilateral ; Stores the numerator and the denominator to find angle A ; Stores the numerator and the denominator to find angle B ; Stores the numerator and the denominator to find angle C : ; Stores the numerator and the denominator to find angle D : ; Driver Code
function findAngles ( a , b , c , d ) { var numerator = a * a + d * d - b * b - c * c var denominator = 2 * ( a * b + c * d ) var x = numerator / denominator document . write ( " " , Math . round ( ( ( Math . acos ( x ) * 180 ) / 3.141592 ) * 100 ) / 100.0 , " " ) ; document . write ( " " ) ; numerator = a * a + b * b - c * c - d * d x = numerator / denominator document . write ( " " , Math . round ( ( ( Math . acos ( x ) * 180 ) / 3.141592 ) * 100 ) / 100.0 , " " ) ; document . write ( " " ) ; numerator = c * c + b * b - a * a - d * d x = numerator / denominator document . write ( " " , Math . round ( ( ( Math . acos ( x ) * 180 ) / 3.141592 ) * 100 ) / 100.0 , " " ) ; document . write ( " " ) ; numerator = d * d + c * c - a * a - b * b x = numerator / denominator document . write ( " " , Math . round ( ( ( Math . acos ( x ) * 180 ) / 3.141592 ) * 100 ) / 100.0 , " " ) ; } var A = 10 var B = 15 var C = 20 var D = 25 findAngles ( A , B , C , D )