Ratio of area of two nested polygons formed by connecting midpoints of sides of a regular N | C # program for the above approach ; Function to calculate the ratio of area of N - th and ( N + 1 ) - th nested polygons formed by connecting midpoints ; Stores the value of PI ; Calculating area the factor ; Printing the ratio precise upto 6 decimal places ; Driver Code
using System ; using System . Collections . Generic ; class GFG { static void AreaFactor ( int n ) { double pi = 3.14159265 ; double areaf = 1 / ( Math . Cos ( pi / n ) * Math . Cos ( pi / n ) ) ; Console . WriteLine ( Math . Round ( areaf ) ) ; } public static void Main ( string [ ] args ) { int n = 4 ; AreaFactor ( n ) ; } }