Question
Write a C++ program that computes a pair of estimates of ?, using a sequence of inscribed and circumscribed regular polygons. Halt after no more
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. And please do not use pi in the program since I am trying to find pi.
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 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 4444Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started