Question: area = p e r i m e t e r a p o t h e m 2 perimeter = n d apothem =

area =perimeterapothem2
perimeter =nd
apothem =d2tan(180n)
where apothem is the shortest distance from the centre of the polygon to one of the polygon sides.
Using the above formulae, write two Python functions:
a. Write a Python function areaPoly (n,d), which given the number of corners, n, in a regular
polygon and the length d of one of its sides, calculate the area of the polygon. You may use some of
the trigonometric functions - such as tangent function - and constant pi () from the math library.
b. Write a Python function polySide(n, area), which given the number of corners, n, in a regular
polygon and the polygon area, calculate the length of one of its sides.
>> areaPoly (4,10)
100.00000000000001
 area =perimeterapothem2 perimeter =nd apothem =d2tan(180n) where apothem is the shortest

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!