Calculate the function sin()

前端 未结 4 1241
情书的邮戳
情书的邮戳 2021-01-13 07:04

For my studies, I have to code an algorithm to calculate sin() with this function:

\"\"

4条回答
  •  一整个雨季
    2021-01-13 07:11

    There are two problems with your code:

    1. sin(x+k*π/2) does not necessarily equal sin(x)
    2. Your expression for the term is a little bit messed up. The instructions seem to suggest that you calculate the next term in the series from the previous term. Start with the value for i=0 and then use the equation in your question to compute the next term in each iteration.

提交回复
热议问题