Ch2_9_s7to10 - Single Result Functions 2 Next Slide...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Chapter 2.9: Single Result Functions 1 Next Slide Previous Slide Determining the sine of an angle using a converging power series A power series determines mathematical and trigonometric functions using powers of the input variable for example : Power series approximation are how <cmath> and your calculator determine mathematical functions We did an example in section 2.8 in which we determined the sine using a power series. We now use that approach to write a single result function which will determine the sine of an angle using the power series: Single result function using a series solution [ ] alternate signs 2 by increments n n x 7 x 5 x 3 x x x n 7 5 3 ; ! ..... ! ! ! ) sin( ± + - + - = ! .... ! ! ! ) exp( n x 4 x 3 x 2 x x 1 x n 4 3 2 + + + + + + =
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Chapter 2.9:
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Single Result Functions 2 Next Slide Previous Slide Single result function: sine(x) Start of the program declare srf function: double sine( ) - one argument call of srf sine(x) in main program begin definition of srf double sine( ) Chapter 2.9: Single Result Functions 3 Next Slide Previous Slide Single result function: sine(x) Function Definition define argument variable for function returns siny to main program ! ..... ! ! ! ) sin( n x 7 x 5 x 3 x x x n 7 5 3 ± +-+-= Chapter 2.9: Single Result Functions 4 Next Slide Previous Slide Single result function: sine(x) Running the Program sine_using_srf.cpp...
View Full Document

This note was uploaded on 05/19/2008 for the course ENGR 25 taught by Professor All during the Spring '08 term at Lehigh University .

Page1 / 4

Ch2_9_s7to10 - Single Result Functions 2 Next Slide...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online