Difference between revisions of "Taylor Series Pi and e"

From WLCS
Line 15: Line 15:
  
 
'''Taylor Series Approximation for Pi:'''
 
'''Taylor Series Approximation for Pi:'''
 +
 
[[File:TaylorSeriesPi.png]]
 
[[File:TaylorSeriesPi.png]]
 
(Wikipedia)
 
(Wikipedia)
  
 
'''Taylor Series Approximation for e:'''
 
'''Taylor Series Approximation for e:'''
 +
 
[[File:TaylorSeriesE.png]]
 
[[File:TaylorSeriesE.png]]
 
(Wikipedia)
 
(Wikipedia)

Revision as of 09:11, 10 November 2015

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.178...)

Resources:

Directions:

  1. Prompt the user for a number N (this will be how many terms you will sum in your approximation)
  2. Use a while loop to iterate N times (you will need a loop counter -- N is not your loop counter)
  3. Use several variables to create the summations for Pi and e seen below
  4. Print out Pi and e

Taylor Series Approximation for Pi:

TaylorSeriesPi.png (Wikipedia)

Taylor Series Approximation for e:

TaylorSeriesE.png (Wikipedia)