Angle of intersection of two circles having their centers D distance apart | Java 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
import java . io . * ; class GFG { static float angle ( float R1 , float R2 , float D ) { float ans = ( R1 * R1 + R2 * R2 - D * D ) / ( 2 * R1 * R2 ) ; return ans ; } public static void main ( String [ ] args ) { float R1 = 3 , R2 = 4 ; float D = 5 ; System . out . println ( angle ( R1 , R2 , D ) ) ; } }