Write a Python function that calculate area of a equilateral polygon


Topic: Write a Python function that calculate area of a equilateral polygon

Solution

import math
def area(no_of_sides, circumradius):
    side_length = 2 * circumradius * math.sin(math.pi / no_of_sides)
    apothem = circumradius * math.cos(math.pi / no_of_sides)
    return no_of_sides / 2 * side_length * apothem



List all Python Programs