Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a C++ program that computes a pair of estimates of , using a sequence of inscribed and circumscribed regular polygons. Halt after no more

image text in transcribedimage text in transcribedimage text in transcribed

Write a C++ program that computes a pair of estimates of , using a sequence of inscribed and circumscribed regular polygons. Halt after no more than 30 steps, or when the difference between the perimeters of the circumscribed and inscribed polygons is less than a tolerance of =10. Your output should have three columns, for the number of sides, the perimeter of an inscribed polygon, and perimeter of the circumscribed polygon. For the last two columns, display 14 digits after the decimal point.

I know this seems pretty long but I have been working on this all day and I am pretty confused please help. Thanks

To get an estimate of r, we start with a regular hexagon inscnbed in a circle of radius the circumference of this circle is r. The side length of this hexagonis aso so its perimeter is 6 Inscribed polygons will always give an estimate that is too small. To compensate, use circumscribed polygons to get an estimate that is too large. To get more accuracy, increase the number of sides. It is most efficient, and easiest to compute, if we keep doubling the number of sides. We will deal with this first CTE -x In the diagram above, we assume that a result. has already been computed, we wish to find e wil be using the Py hagorean Theorem twice to do the computation, the value o x must be computed as an intermediary Here is the computation of x. 22 4444

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

Students also viewed these Databases questions

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago