Angle of intersection of two circles having their centers D distance apart | C ++ program for the above approach ; 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
#include <bits/stdc++.h> NEW_LINE using namespace std ; float angle ( float R1 , float R2 , float D ) { float ans = ( R1 * R1 + R2 * R2 - D * D ) / ( 2 * R1 * R2 ) ; return ans ; } int main ( ) { float R1 = 3 , R2 = 4 ; float D = 5 ; cout << angle ( R1 , R2 , D ) ; return 0 ; }