Distance between Incenter and Circumcenter of a triangle using Inradius and Circumradius | C ++ 14 program for the above approach ; Function returns the required distance ; Driver code ; Length of Inradius ; Length of Circumradius
#include <bits/stdc++.h> NEW_LINE using namespace std ; double distance ( int r , int R ) { double d = sqrt ( pow ( R , 2 ) - ( 2 * r * R ) ) ; return d ; } int main ( ) { int r = 2 ; int R = 5 ; cout << ( round ( distance ( r , R ) * 100.0 ) / 100.0 ) ; }