text: Check if a circle lies inside another circle or not | javascript program to check if one circle lies inside another circle or not . ; Driver code
code: function circle ( x1 , y1 , x2 , y2 , r1 , r2 ) { var distSq = parseInt ( Math . sqrt ( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) ) ) ; if ( distSq + r2 == r1 ) { document . write ( " " + " " + " " + " " ) ; } else if ( distSq + r2 < r1 ) { document . write ( " " + " " + " " + " " ) ; } else { document . write ( " " + " " ) ; } } var x1 = 10 , y1 = 8 ; var x2 = 1 , y2 = 2 ; var r1 = 30 , r2 = 10 ; circle ( x1 , y1 , x2 , y2 , r1 , r2 ) ;