Distance between centers of two intersecting circles if the radii and common chord length is given | Java program to find the distance between centers of two intersecting circles if the radii and common chord length is given ; Driver code
import java . lang . Math ; import java . io . * ; class GFG { static double distcenter ( int r1 , int r2 , int x ) { double z = ( Math . sqrt ( ( r1 * r1 ) - ( x / 2 * x / 2 ) ) ) + ( Math . sqrt ( ( r2 * r2 ) - ( x / 2 * x / 2 ) ) ) ; System . out . println ( " distance ▁ between ▁ the " + " ▁ centers ▁ is ▁ " + ( int ) z ) ; return 0 ; } public static void main ( String [ ] args ) { int r1 = 24 , r2 = 37 , x = 40 ; distcenter ( r1 , r2 , x ) ; } }