Distance between Incenter and Circumcenter of a triangle using Inradius and Circumradius | Python3 program for the above approach ; Function returns the required distance ; Length of Inradius ; Length of Circumradius
import math NEW_LINE def distance ( r , R ) : NEW_LINE INDENT d = math . sqrt ( ( R ** 2 ) - ( 2 * r * R ) ) NEW_LINE return d NEW_LINE DEDENT r = 2 NEW_LINE R = 5 NEW_LINE print ( round ( distance ( r , R ) , 2 ) ) NEW_LINE