Question: The sin function can be expressed as a series expansion: (see image) Use a midpoint break loop to approximate the value of sin(x). Break the
The sin function can be expressed as a series expansion:
(see image)
Use a midpoint break loop to approximate the value of sin(x). Break the loop when the new term in the summation series is smaller than +/- 0.00001 (the tolerance).
Test your function by comparing it to the built-in sin function evaluating x = pi/2
Display, using format long, the sin approximation, the number of terms required to reach the tolerance, and the value of the built-in sin function.
Note that the repeating term in the above expansion is
(see image)
where k is the incremented variable.
The sin function can be expressed as a series expansion: 3 9 Use a midpoint break loop to approximate the value of sin(x). Break the loop when the new term in the summation series is smaller than +/- 0.00001 (the tolerance) Test your function by comparing it to the built-in sin function evaluating x pi/2 Display, using format long, the sin approximation, the number of terms required to reach the tolerance, and the value of the built-in sin function. Note that the repeating term in the above expansion is where k is the incremented variable
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
