Unformatted text preview: Assignment 1 Page 10 of 11 digits of π; all we have to do is multiply Equation (1) by 1050 and evaluate the result using integers. Here’s what the series for 1/5 looks like: (4) arctan = · + · · + · . . . The series for 1/239 is similar. What to do Write a script file (program) that produces output as similar as you can to the sample output on the next page. Do the steps below in order, one at a time. When you evaluate an infinite series, follow these rules to get full marks. • Rule 1: use a while loop. Loop until the value of the next term is insignificant. If you are using float calculations and you need 3 decimal places in the result, assume that terms < 0.0001 in size are insignificant. For 6 places you need a smaller criterion. If you are using integer calculations, assume that only 0 valued terms are insignificant. • Rule 2: use the variables count, product, term and total as in class examples. Initialize these variables outside the while loop, and update them every time through the while loop. Steps: 1. Using the tangent value printed in the output of Question 2, evaluate the arctan series in Equation (1) to determine the angle in radians. The result should be the same as in Question 2, correct to 3 decimal places. 2. Using the tangent value of 1, evaluate the arctan series in Equation (2) to estimate π to 6 decimal places. Note: this step will run slowly. When you have it working correctly, comment it out while you work on the next step, so you won’t have to wait for it to finish each time. But remember to uncomment it for your final results. 3. Using Machin’s formula a...
View
Full Document
 Winter '14
 TerryAndres
 Computer Science, Velocity, Cannon

Click to edit the document details