Difference between revisions of "Taylor Series Pi and e"
From WLCS
Line 31: | Line 31: | ||
'''Challenge:''' | '''Challenge:''' | ||
* Implement the Taylor series calculations for sin(x) and cos(x) | * Implement the Taylor series calculations for sin(x) and cos(x) | ||
+ | * [https://en.wikipedia.org/wiki/Taylor_series#List_of_Maclaurin_series_of_some_common_functions Taylor/Maclaurin series of common functions] |
Revision as of 10:25, 6 January 2017
Objective:
- You will use loops to determine the approximations of mathematical constants
- You will implement the Taylor series approximation of Pi (~3.1415...)
- You will implement the Taylor series approximation of e (~2.718...)
Resources:
Directions:
- Prompt the user for a number N (this will be how many terms you will sum in your approximation)
- Use a while loop to iterate N times (you will need a loop counter -- N is not your loop counter)
- Use several variables to create the summation for Pi
- Print out Pi
- Repeat the above steps for approximating e
Taylor Series Approximation for Pi:
(Wikipedia)
Taylor Series Approximation for e:
(Wikipedia)
Challenge:
- Implement the Taylor series calculations for sin(x) and cos(x)
- Taylor/Maclaurin series of common functions