Distance between Incenter and Circumcenter of a triangle using Inradius and Circumradius | Function returns the required distance ; Length of Inradius ; Length of Circumradius
function distance ( r , R ) { let d = Math . sqrt ( Math . pow ( R , 2 ) - ( 2 * r * R ) ) ; return d ; } let r = 2 ; let R = 5 ; document . write ( Math . round ( distance ( r , R ) * 100.0 ) / 100.0 ) ;