Program to find the Circumcircle of any regular polygon | Python3 Program to find the radius of the circumcircle of the given polygon ; Function to find the radius of the circumcircle ; these cannot be negative ; Radius of the circumcircle ; Return the radius ; Driver code ; Find the radius of the circumcircle
from math import * NEW_LINE def findRadiusOfcircumcircle ( n , a ) : NEW_LINE INDENT if n < 0 or a < 0 : NEW_LINE INDENT return - 1 NEW_LINE DEDENT radius = a / sqrt ( 2 - ( 2 * cos ( 360 / n ) ) ) NEW_LINE return radius NEW_LINE DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT n , a = 5 , 6 NEW_LINE print ( round ( findRadiusOfcircumcircle ( n , a ) , 5 ) ) NEW_LINE DEDENT