Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions