Ratio of the distance between the centers of the circles and the point of intersection of two direct common tangents to the circles | Function to find the GCD ; Function to find the ratio ; Driver code
function GCD ( a , b ) { return ( b != 0 ? GCD ( b , a % b ) : a ) ; } function ratiotang ( r1 , r2 ) { document . write ( " " + r1 / GCD ( r1 , r2 ) + " " + r2 / GCD ( r1 , r2 ) ) ; } var r1 = 4 , r2 = 6 ; ratiotang ( r1 , r2 ) ;