Radius of a circle having area equal to the sum of area of the circles having given radii | Java program to implement the above approach ; Function to calculate radius of the circle having area equal to sum of the area of two circles with given radii ; Area of first circle ; Area of second circle ; Area of third circle ; Radius of third circle ; Driver code ; Given radius ; Prints the radius of the required circle
import java . util . * ; class GFG { static double findRadius ( double r1 , double r2 ) { double a1 , a2 , a3 , r3 ; a1 = 3.14 * r1 * r1 ; a2 = 3.14 * r2 * r2 ; a3 = a1 + a2 ; r3 = Math . sqrt ( a3 / 3.14 ) ; return r3 ; } public static void main ( String [ ] args ) { double r1 = 8 , r2 = 6 ; System . out . println ( ( int ) findRadius ( r1 , r2 ) ) ; } }