{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Ch2_9_s7to10

# Ch2_9_s7to10 - Single Result Functions 2 Next Slide...

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

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 + + + + + + =

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

View Full Document
Chapter 2.9:

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

View Full Document
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

{[ snackBarMessage ]}