Check if two given Circles are Orthogonal or not | Function to Check if the given circles are orthogonal ; calculating the square of the distance between C1 and C2 ; Check if the given circles are orthogonal ; Driver code
function orthogonality ( x1 , y1 , x2 , y2 , r1 , r2 ) { let dsquare = ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) ; if ( dsquare == r1 * r1 + r2 * r2 ) return true ; else return false ; } let x1 = 4 , y1 = 3 ; let x2 = 0 , y2 = 1 ; let r1 = 2 , r2 = 4 ; let f = orthogonality ( x1 , y1 , x2 , y2 , r1 , r2 ) ; if ( f ) document . write ( " " ) ; else document . write ( " " ) ;