Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Approximate at 5 points The value of a equals the circumference of a circle with radius 1/2. Suppose we approximate the circumference by a polygon

image text in transcribed

Approximate at 5 points The value of a equals the circumference of a circle with radius 1/2. Suppose we approximate the circumference by a polygon through n +1 points on the circle. The length of this polygon can be found using the pathlength function from the previous exercise. Compute n +1 points (di, Yi) along a circle with radius 1/2 according to the formulae Xi = COS 1 / 2 mi Yi = -sin = ) 2 ln . = 0,...,n. Write a function circle_pts( n ) which accepts a number of sides n and returns a pair of list s (as a tuple ) containing the x and y coordinates of the approximating polygon. You will need to include your working pathlength function from the previous exercise. Write a function approx_pi( n ) for approximating a by the path length L resulting from the pairs of coordinate lists returned by circle_pts( n ). Your answer should include three functions: pathlength , circle_pts , and approx_pi. (This assignment is based on Langtangen, Exercise 3.18.) Approximate at 5 points The value of a equals the circumference of a circle with radius 1/2. Suppose we approximate the circumference by a polygon through n +1 points on the circle. The length of this polygon can be found using the pathlength function from the previous exercise. Compute n +1 points (di, Yi) along a circle with radius 1/2 according to the formulae Xi = COS 1 / 2 mi Yi = -sin = ) 2 ln . = 0,...,n. Write a function circle_pts( n ) which accepts a number of sides n and returns a pair of list s (as a tuple ) containing the x and y coordinates of the approximating polygon. You will need to include your working pathlength function from the previous exercise. Write a function approx_pi( n ) for approximating a by the path length L resulting from the pairs of coordinate lists returned by circle_pts( n ). Your answer should include three functions: pathlength , circle_pts , and approx_pi. (This assignment is based on Langtangen, Exercise 3.18.)

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