Circumradius of a Cyclic Quadrilateral using the length of Sides | C ++ program to find circumradius of a cyclic quadrilateral using sides ; Function to return the circumradius of a cyclic quadrilateral using sides ; Find semiperimeter ; Calculate the radius ; Driver Code ; Function call ; Print the radius
#include <bits/stdc++.h> NEW_LINE using namespace std ; double Circumradius ( int a , int b , int c , int d ) { double s = ( a + b + c + d ) / 2.0 ; double radius = sqrt ( ( ( a * b ) + ( c * d ) ) * ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( s - a ) * ( s - b ) * ( s - c ) * ( s - d ) ) ) ; return radius / 4 ; } int main ( ) { int A = 3 ; int B = 4 ; int C = 5 ; int D = 6 ; double ans = Circumradius ( A , B , C , D ) ; cout << setprecision ( 3 ) << ans ; return 0 ; }