Distance between Incenter and Circumcenter of a triangle using Inradius and Circumradius | C # program for the above approach ; Function returns the required distance ; Driver code ; Length of Inradius ; Length of Circumradius
using System ; class GFG { static double distance ( int r , int R ) { double d = Math . Sqrt ( Math . Pow ( R , 2 ) - ( 2 * r * R ) ) ; return d ; } public static void Main ( string [ ] args ) { int r = 2 ; int R = 5 ; Console . Write ( Math . Round ( distance ( r , R ) * 100.0 ) / 100.0 ) ; } }