Length of Diagonals of a Cyclic Quadrilateral using the length of Sides . | C # Program to implement the above approach ; Function to calculate the length of diagonals of a cyclic quadrilateral ; Driver Code ; Function Call ; Print the readonly answer
using System ; using System . Collections . Generic ; class GFG { static List < float > Diagonals ( int a , int b , int c , int d ) { List < float > ans = new List < float > ( ) ; ans . Add ( ( float ) Math . Sqrt ( ( ( a * c ) + ( b * d ) ) * ( ( a * d ) + ( b * c ) ) / ( ( a * b ) + ( c * d ) ) ) ) ; ans . Add ( ( float ) Math . Sqrt ( ( ( a * c ) + ( b * d ) ) * ( ( a * b ) + ( c * d ) ) / ( ( a * d ) + ( b * c ) ) ) ) ; return ans ; } public static void Main ( String [ ] args ) { int A = 10 ; int B = 15 ; int C = 20 ; int D = 25 ; List < float > ans = Diagonals ( A , B , C , D ) ; Console . Write ( " { 0 : F2 } ▁ { 1 : F2 } " , ( ans [ 0 ] ) + .01 , ans [ 1 ] + .01 ) ; } }