Circumradius of a Cyclic Quadrilateral using the length of Sides | Function to return the circumradius of a cyclic quadrilateral using sides ; Find semiperimeter ; Calculate the radius ; Driver code ; Function call ; Print the radius
function Circumradius ( a , b , c , d ) { var s = ( a + b + c + d ) / 2.0 ; var radius = Math . sqrt ( ( ( a * b ) + ( c * d ) ) * ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( s - a ) * ( s - b ) * ( s - c ) * ( s - d ) ) ) ; return radius / 4 ; } var A = 3 ; var B = 4 ; var C = 5 ; var D = 6 ; var ans = Circumradius ( A , B , C , D ) ; document . write ( ans . toFixed ( 2 ) ) ;