Angle of intersection of two circles having their centers D distance apart | Function to find the cosine of the angle of the intersection of two circles with radius R1 and R2 ; Return the cosine of the angle ; Driver Code
function angle ( R1 , R2 , D ) { var ans = ( R1 * R1 + R2 * R2 - D * D ) / ( 2 * R1 * R2 ) ; return ans ; } var R1 = 3 , R2 = 4 ; var D = 5 ; document . write ( angle ( R1 , R2 , D ) ) ;