Descartes ' Circle Theorem with implementation | Function to find the fourth circle 's when three radius are given ; Radius of three circles ; Calculation of r4 using formula given above
function findRadius ( r1 , r2 , r3 ) { let r4 = ( r1 * r2 * r3 ) / ( r1 * r2 + r2 * r3 + r1 * r3 + 2.0 * Math . sqrt ( r1 * r2 * r3 * ( r1 + r2 + r3 ) ) ) ; return r4 . toFixed ( 6 ) ; } let r1 = 1 ; let r2 = 1 ; let r3 = 1 ; let r4 = findRadius ( r1 , r2 , r3 ) ; document . write ( " " + r4 ) ;