Question: python 1. (5 points) write a function to calculate the sine function using the infinite series below. The function should take two arguments the r
1. (5 points) write a function to calculate the sine function using the infinite series below. The function should take two arguments the r and n, where n is the number of terms to include in the calculation of sin(x). n should have a default value of 10. + 7! 9! sin(x) = 2 3! 5! Test your function with the following program. print (my_sin(0)) print(my_sin(1,3)) print (my_sin(math.pi/2)) print(my_sin(math.pi/4)) print (my_sin(math.pi/6)) You should get the following output 0.0 0.8416666666666667 1.0 0.7071067811865475 0.49999999999999994 Process finished with exit code o
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
